Pierre Baudoin

Ludum Dare 51

Diving into WOOLLY FIRE's grid system

Hi guys, Pierre here.

I wanted to talk about the way i developped our grid generation tool during the Jam 51. Nothing revolutionary, but I’m sure it will be interesting for some. But first of all, I need to pitch the game since most of you didn’t test it :

A fire has start in the countryside and your job is to manage the firefighters response. EVERY TEN SECONDS, the fire will grow and try to spread through the grid. Fill your trucks and send them on the firefront. Try to understand how the cellular automaton works

(Play and rate us here: https://ldjam.com/events/ludum-dare/51/fires-away)

OK, so let’s start with our grid system with a bit of oubviousness A grid is a group of connected cells. Those can be the same (like in chess) and be seen as physical container that can be fill by a pawn, an agent or a unit (or whatever, name it as you wish). But it’s not the case in our game, every single cell has in reality a ‘cell type’ that influence the behavior of fire in it. For instance, a wheat cell burn faster than a forest cell, and water cell just can’t.

In the curent game, there are 5 different cell type : Forest, Plain, Village, Water and Wheat. Each of these have an interest in the game. Plain is kind of the base type, Forest and Wheat are reskin with diferent fire propagation values that make fire slow or speed up. Water refill the tanks in the next cells and villages are a losing condition. I won’t dive into details because it already a long post and I didn’t even start to talk about texture.

So ! We want to have a grid containing cells but each of them is one of the 5 types we just saw. We could just create 5 prefabs and smile to the level designer and say : « Your turn to place the 256 prefabs ! Good luck ! … And do it well otherwise you’ll have to iterate :D ». But we’re not this kind of person, obviously not. We actualy are the rock of the team, the one without nothing could be done, the all mighty programmer and it is time to be merciful.

In order to ease their job, I personnaly thought about texture almost instantly. What are texture if it’s not a grid of pixel having each a diferent type (i mean color) ? I paired a cellType with a color, made my very best piece of art in microsoft paint and loop through every pixel comparing the color of it with the types color. If match then cellType prefab instantiation ! Et voilà ! To edit your level, you just have to edit the texture.

In out game, each cell has an ‘int’ attribute to discribe the fire state (0 = normal, 1 = low fire, 2 = medium, 3 = high, 4 = burnt). So i used the same technique and paired a fire state with a color. I created a second texture and job’s done.

The more I look at my code, the more I feel inconfortable. But it’s a jam, that’s OK, i’ll share it (if you copy it, please make it clean) :

LDJam code.png

NOTE : - when you import a texture, you have to enable the READ/WRITE to be able to read the pixel value. Anyway, if not Unity will return you an error. BUT it won’t let you any advice if you let the default parameters for COMPRESSION and FILTER MODE. Deactivate them otherwise the engine will try to smooth your texture and it will modify you pixels color.

  • for the fire state, i could have used a RGB chanel wich is already an int. That should saved some memory, but since there are 5 states, I chose to ease the color differentiation while editing the texture and saving others time instead of 5 Vector4 in the RAM.

  • To create the diferent cellTypes, FireState, etc. I used the ScriptableObject tool. This allow you to create preset for non MonoBehavior classes and structures in the editor. I won’t dive deeper into it, bur I recommand you to learn, practise and master this tool. Here is what it looks like :

LDJam scriptable.png

Thank you for reading, I hope this would help someone.

Ludum Dare 52

One week left

Hello beautiful people!

Only one week left until the results. I hope you had some rest and some feedback on your projects.

Answer me if you didn't get your 20 ratings, I'll try to test your games before the end.

On our side we had almost 30 ratings. Can we go further? Feel free to test our project and give us feedback.

LINK HERE -> https://ldjam.com/events/ludum-dare/52/celestial-wheatfield

https://youtu.be/qsjpWK4bYpI

Have a nice week everyone and may the odds be ever in your favor

Ludum Dare 53

Jam is over, tests begin !!

Good morning everyone,

I hope you are well and that you have been able to rest

Here is some screen of our new game : -- Station Zero : Data Rogue --

image 3.png

image 2.png

It's a open world where your character has to deliver data at some location. Twist : there is neither up nor down, so don't get lost !

(Play and rate us here: https://ldjam.com/events/ludum-dare/53/station-zero-data-rogue)

I will come back to you in the next post with more detail. Hope you'll like the game !!

PS: grab your gamepad

Prepare your gamepad !

Despite not being able to get a working webGL build, I am very proud of our jam.

Feel free to test and rate our game, we only have positive feedback so far !

If you have an approach to the theme similar to ours. Link your game under this post, I'm interested to see how you approach it.

https://ldjam.com/events/ludum-dare/53/station-zero-data-rogue

5a982.png