All posts tagged with "programmer art"

Acceleration Structures

Clockwork Empires relies internally on a series of tags, as I think we’ve discussed on this blog far too many times. When you go to look for something like food, we check the game for every object with the “raw_food” tag, and then you go to eat it. Here is where the bad news happens: once you have a sufficiently long game, you can stockpile large quantities of food. Let us say that a player has 500 pieces of raw food. Let us also say you have 150 characters – so, to put it into perspective, the player has accumulated 3 days worth of food. (This isn’t even that large a number.) Every day, the 150 characters must go and eat 150 pieces of food out of the 500. The problem is – they want to eat the *closest* food. So now we have to check 500 pieces of food vs 150 players to see which piece is the closest, for a total of 150 * 500 = 75,000 distance queries. Well, that can be a bit slow, especially when our AI budget is very tight and we have a lot to do. However, we’re now seeing games where characters have huge amounts of food – 5,000 pieces of food, say – and the game slows to a crawl. Clearly, smarter programming is required.

A lovely sea-side desert colony sent in by a player as part of a bug report.

A lovely sea-side desert colony sent in by a player as part of a bug report.

Clockwork Empires stores all information about object positions in a spatial dictionary. The handling of tags is done by a “tag index” class, which is essentially a giant array of information consisting of the following attributes: “position, object, previous item with this tag, next item with this tag”. When a tag is set, we grab a tag index from a giant statically allocated pool of tag indices, so that we don’t have a memory allocation, and attach it to the linked list of tags. The problem is… there’s no way to easily find the “closest” tag to your point. What is needed is a spatial acceleration structure of some kind – a way of dividing the world into regions so that we can start in our region, check it for the closest whatever, and then move on.

{ read this article }

Posted in Clockwork Empires | Tagged , , , , , , ,
17 Comments

Shades of Tofu

[SCENE: The Gaslamp Games Offices. THE NEW OFFICES. DAVID BAUMGART, ART DIRECTOR, enters the Break Room.]

David Baumgart, Art Director, enters the break room. Programmer Art Depiction.

David Baumgart, Art Director, enters the break room. Programmer Art Depiction.

DAVID: Wizards, grain silos, Utretcht, tank simulation… ah, it is good to be a vegan! Horrible frost giants! And now, lunch.

[DAVID opens the door of the fridge. Inside is BEEF JERKY, which leaps out and attacks him.]

DAVID: Alas! I die.

[HE COLLAPSES. Enter DANIEL and NICHOLAS from the Break Room Door.]

NICHOLAS: David is being attacked by beef jerky! It must be Wednesday. Quickly, get him onto the table.

[THEY DO SO. The table collapses. OH WELL.]

DANIEL: The beef jerky is … attacking his mind, somehow. It’s corrupting his vegan essence.
DAVID: I… deny then… my essence…

[SCENE: In David’s mind, terrible flashbacks occur. The company is formed in a basement. Dredmor ships.]

NICHOLAS: Fascinating.
DANIEL: You can’t say that – we’re parodying The Next Generation, not The Original Series.
NICHOLAS: Look! He’s remembering old blog posts… in his dreams.

[DAVID PROCEEDS TO REMEMBER.]

David Baumgart proceeding to remember happy memories (in this case, a carrot.) Programmer Art Depiction.

David Baumgart proceeding to remember happy memories (in this case, a carrot.) Programmer Art Depiction.

DAVID: mumble, mumble… Scott Pilgrim ruined it for all of us… mumble…

DANIEL: Now it looks like he’s experiencing good memories.

[DAVID PROCEEDS TO REMEMBER “GOOD MEMORIES”:

Clockwork Empires’ Early Access Announcement
– That GDC trip where Stephanie got us all Hand Lotion
Six months of early access updates!
– 4,700+ repository commits
– 22 experimental builds released to the public
– coverage from just about every major PC gaming site on the planet
The Beauty of Poetry
Whatever this thing is!]

DANIEL: It’s no good. The Beef Jerky is getting to him. Maybe if we make him… remember bad memories, it will damage the virus. Jerky. Jerky virus.
NICHOLAS: We can induce bad memories with Medicinal Liniments. Remember, under no circumstances take medical advice from me!DANIEL: Aren’t all those good memories *your* blog posts?
NICHOLAS: Whatever. Here, let me stick needles into his head.

[DAVID PROCEEDS TO REMEMBER “BAD” MEMORIES”:

– Making three Clockwork Empires Trailers
– That GDC trip where Stephanie got us all Hand Lotion
– The last time we parodied Inception]

DANIEL: Hang on, let me set this machine to “Programmer Art.” There we go.

[DAVID AWAKES, SCREAMING.]

David Baumgart Awakes from a Horrible Dream. (Also, he is wearing Mittens for some reason.) Programmer Art Depiction.

David Baumgart Awakes from a Horrible Dream. (Also, he is wearing Mittens for some reason.) Programmer Art Depiction.

DAVID: What happened?
DANIEL: You’re on vacation, so we made fun of you in our year-end wrap-up blog post.
DAVID: Ah, it must be Wednesday!

NICHOLAS: That’s it for us, folks. As always, we thank you for your patronage and look forward to seeing you in 2015! Happy New Year!
DAVID: … who are you talking to again?
DANIEL: Gnomes!

[ALL LAUGH. CREDITS ROLL.]

 

 

Posted in Uncategorized | Tagged , , , , , , , , , , , , ,
3 Comments