Where to play
Currently not available due to unfinished status of the prototype.Tools
Created with the following software:Audacity
Aseprite
Godot
Progress
Read the devdiary / progress report here. Most recent on top.2017-02-24: Balance Tables
![]() |
| First draft |
First, I read into the documentation about RichTextLabels, which was quite fast, because there isn't any. There's a list of functions, but what they do I had to find out through experimentation. I'm not uninitiated to BBCode, so I kinda got the twist of it. The results were ... okay. It was ASCII-art style tabling. Not hideous, but it would do. Except it wouldn't, because as soon as I resized the window, everything broke. Same for switching locales. Misalignments galore.
So the whole thing needed to be redone. This time with dynamic creation and scrollbars, so it would be automatically extended and still work. Looks nice, too. However, the cost for this beauty are several 100 (unlocked) fps. Lotsa nodes, lotsa costly code. Next task in this area will be to make a refresh function that doesn't just raze everything and rebuilds it completely.
2017-02-22: Externalisation
Externalised my data. More specifically, the data for constructs / buildings and the configuration for the tile drawing, as mentioned in 2017-02-19. The way constructs are written allows for theoretically infinite construction and production cycles to be added to a construct, so that's neat. However it's all just in a txt file; I can't shake the feeling that a table format would have been better in the long run, because right now I just write a 9 element array for production cost and another 9 element array for the production gain for a cycle. This becomes a problem when I change my opinion about the number or order of resources. Doesn't matter for now. Can't waste months just for a prototype again. I'm already giving detail way too much attention instead of creating core mechanics. I want to swear an oath for betterment, but I have doubts I will not break it.I also noticed that my initial layout for the inspector was ridiculously small. It was parked in the upper right corner with a size of 200 x 300, but with the amount of text displayed by a single empty construct it was already pushing the limits of readability. So I moved it where every sensible RTS except CnC has: bottom edge.
2017-02-19: Inspection
Created a tile inspector. A panel that shows the different attributes of a tile and will later allow building constructs, laying roads, adjusting rates and routes. It's working okay so far, but that's because it doesn't have a lot to do. Selection logic is working fine though.Also started work on constructs. This means cities, factories, farms etc. that consume and produce resources. Before I test the logic I want to implement datasheet loading for them, so today's entry is rather scarce.
2017-02-18: Borders
![]() |
| Incorrect |
Drawing those borders had me experiment with the shader resources. Would I shade the whole tile? Why is everything the same color? How does visual shader writing work? The answers: No, because it's really hard to differentiate between a tile of water and a tile belonging to the blue player. Everything is the same color, because it uses the same material; to correct this, every tile has to use an instance of that material. Well enough for me to understand.
Working on the territory borders also revealed a flaw in the creation code. When checking for borders to be drawn, a tile looks up its neighbours in an array and draws a border if that neighbouring tile has a different owner. Borders were only drawn in directions up and left. When detecting the array of neighbours, not all tiles were actually created yet. This means that upon creation a tile would look in all five directions, but only find empty cells further down in the timeline. Correcting this also fixed the layering issue I thought I had with drawing connections to neighbouring tiles.
Things work themselves out sometimes.
![]() |
| Correct |
2017-02-15: Terrain
Set up basic terrain. Mountains, hills, plains, forests, and water. The latter is not traversible, so its links to the neighbours have been cut. Tiles detect which links to cut and restore themselves.
Added controls to toggle overlays. Terrain is one of them, the others are political (tile ownership) and different resources (workforce, conscripts, food, money). Toggling between them is happening at the press of a button. Made some icons for them, but those images already clash with the "flatshaded" minimalist look the game had so far.
Still thinking about whether I'll have the tiles hold the production data and all, or to separate that into city objects. I'd really like the data to stay inside the tiles, but they are about to become a mammoth class. We'll have to see.
2017-02-14: Time
Implemented time controls. Four speeds, pause button, hotkey, and resuming with the speed selected before the pause. Easy peasy. Even got a nifty progressbar to show for it. All themed in warm, tasteful browns.
Most of the day was spent exploring an alternative world construction. The way I've done it every tile is a node. I know that that seems wasteful at first, but I strongly believe it will prove useful later when adding more data and overlays to the mix. What I tried to do however was to use a single node to hold all the data and responsibility of drawing. Turns out I am not good enough at batching draw calls and effective culling. FPS tanked hard. So why waste time reinventing the wheel? I got progress to make, damnit!
2017-02-13: Game of Life
I don't know why I was worried. Rotating the grid was as easy as setting the parent node's transform. Literally 5 seconds. Camera bounds are detected automatically on generation. Everything's fine.
To pass the time (and check whether or not I had gotten the neighbouring logic right) I made a small cellular automata out of the grid. Every cell is set to one of three random colors, then every tick a cell takes on the color most represented in its immediate neighbours. It worked, even though the way I implemented it was sluggish as hell and a 16x16 grid dropped below 60 fps. Good thing I don't plan to implement anything like this for real...
2017-02-12: Cairo Tiling
Another week, another project. Fuck being consistent and actually finishing something. Or getting a project through the prototype phase. I need to stop doing this. But I really reduced the scope this time, I swear!I'm glad I haven't completely slept through trigonometry. Still took me a whole day to figure out the (unit)dimensions of this pentagon, how to rotate it and how to spawn others with the correct offset to create a tiling grid. Making each tile a separate object may not have been the smartest move, but this doesn't feel like I'd make yuuuge maps in it. Doesn't matter for now. Currently spawning the tiles according to the dual, the snub square tiling. Just a small "problem": The grid steers off to the right and the top. I will have to rotate everything by a small amount - this small rotation will most likely result in very floating point error prone offsets however. Prison Architect players never complained about the 50% grey background...







No comments:
Post a Comment