Jump to content
  • Advertisement
  • entries
  • comments
  • views

Where mah garbageman?

Sign in to follow this  


Let me just register my sentiment, for the record, that manual memory management is crap. Therefore, by extension, C++ is crap.

I honestly wonder how much cleaner this stupid scenegraph would be if I could just use a proper garbage collected language. Unfortunately, I don't have that choice right now. Even a bolt-on GC for C++ is really more than we can afford to try and integrate right now.

I think if it weren't for boost::shared_ptr I'd have jumped out of my window by now.

Of course, that wouldn't have done a whole lot, seeing as I live on the ground floor and all. But the symbolic act of hopelessness and despair would have been awe inspiring.

So anyways, at the moment I'm working out all the gritty details of who exactly "owns" scenegraph nodes, who creates/destroys them, and all that such stuff. Once I get it all figured out, I'll do my RWGD post and talk about the results, as well as the cameras-aren't-scenegraph-nodes thing.

Assuming, of course, that anyone in the world actually gives a flying lemur kidney about any of it [grin]
Sign in to follow this  


Recommended Comments

Guest Anonymous Poster


I fondly remember my introduction to manual memory allocation in a programming assingment involving linked lists. It went downhill from there. Long live Turbo Pascal!

Share this comment

Link to comment
Guest Anonymous Poster


ApochPiQ - your efforts are not unappreciated! I read your blog every day, with great interest. As a a programmer myself, I sympathize with the memory management, er, garbage.

Make sure you keep yourself sane with some higher level abstract reading. I've been immensely enjoying "Swarm Intelligence," by James Kennedy and Russell C Eberhart. Plus, I can't help but think that what they are writing about socio-dynamic simulations and genetic and evolutionary algorithms could help you to 'evolve' the constraints/rules for a dynamic camera system. I mean, it's basically an NP-complete problem... What you need is not a high level intelligence, but intelligent behavior emulated from the bottom up... a series of simple agent rules e.g.,
1) I like areas where there is a large grouping of ships
2) I like ships that are moving rapidly
3) I like ships that are firing
4) I like ships that are exploding
5) I like ships that are economically valuable
6) I like ships that are large

paired with :

A) I like the player's ships best
B) I like it best when the player's ships are low on health or shields
C) I like it best when the player's ships are being attacked,

Then you place say 40 'cameras' semi-randomly (higher distribution in more heavily populated areas) in simulated space in a sector, with the rule that they must be close to at least 1 ship.
You eliminate from the 'gene pool' any cameras that overlap with objects
You test rules 1-6 in terms of 'bounded' proximity (i.e., you want the camera 200 yards away from all objects in the scene that are moving rapidly, firing, exploding, etc.).
You produce a 'score' for each camera, favoring the cameras that match up with A) B) and C).
You 'mate' the x, y, z values of successful cameras that are close to each other
and compare the scores produced to the 'parent' scores.
If no improvement has been produced, set the orientation for one of the parent cameras, and film.
If multiple improvements have been produced, mate the improvements, compare the scores again, etc.
Determine your cutoff point for the rate of score improvement and film when that rate of change has dropped off to the cutoff.

Anonymous Fan

Share this comment

Link to comment
Sounds interesting; I'll check it out, thanks!

Actually to be honest I've been toying with the idea of combining some hand-made heuristics with some genetic training to try and produce good algorithms for the final system. The 3D engine work I'm doing right now is largely to support the experiments that I want to try; the fact that it also benefits the rest of the team (especially the art pipeline) is just a really handy fringe benefit [grin]

Amazon says 5-9 business days. I've had good luck so far with the reading suggested in my journal comments, so hopefully that trend will continue [wink]

Share this comment

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!