Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

1343045 Posts in 61492 Topics- by 53034 Members - Latest Member: io-games

July 18, 2018, 08:12:34 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityDevLogsProject_BuildTutto: a deep resource management building and crafting game.
Pages: [1] 2
Print
Author Topic: Project_BuildTutto: a deep resource management building and crafting game.  (Read 2545 times)
ElkiwyDev
Level 0
***


View Profile
« on: November 03, 2017, 06:51:15 AM »

Hello everyone!
I'm Stefano, and I recently graduated in Computer Science, and with that done I can finally work seriously on my project, which is temporary called "Project_BuildTutto".

The idea for the game
Project_BuildTutto is a managing-crafting-simulating-mindmelting game where you have to manage a company that builds buildings. To build those buildings first you have to build all the things: walls, cables, generators, furniture, facilities, and so on. All these things can be built however the players wants because he will start the game with only raw materials as resource and, through a blueprint system, he will have to invent all the items he will need.
By "however the player wants" I mean that, for example, to build a wall he first have to build bricks, and to build those bricks he can use whatever raw material he want (raw iron will make iron brick so he will make an iron wall, but raw paper will make paper bricks and he will make a paper wall which will collapse on itself if he build stuff over it!). With this logic the player would be also able to make engines with cloth which will catch fire as soon as he starts it up. Or maybe, if he is really rich, he could even make gold engines which will be a bit more resistant but also a lot heavier.
Once the player invents all the things he need through this blueprint process he will be able to set orders to his employees to build stuff in his factory. This location will be a level that you build yourself with your things, and it will be the production site where you build all the necessary items to transfer to the various location where the player will be asked to build the right buildings.
The goal of the game will be to satisfy all the requests for buildings and optimize their revenue that will be shared with the player.
The plan for it is to have a finite amount of levels (Buildings to build) with specific requirements (example: build a factory with 10 employee that produces 10 computers a day) and once the player finishes those there will be a procedural system to give an infinite amount of levels to the player at increasing complexity.

The development process
Right now the project is in a super early stage and there is no game right now. I'm still building the basic structure of it, but I decided to start early the devlog here to be able to document every part of the development and let all the people interested in it know what I'm doing and how the project is growing step by step.

Enough talk, show me what you have now.
Right, here is a screenshot of it:


Not really exciting, huh? Well, as I said I'm focussing this early development on the actual basic mechanics so maybe a gif will explain better what the game right now *can* do:


   •   In the gif you can see how the working guy can recognize that there is an order that can be completed (Building a wall object (the green thing)). To build a wall he needs 4 blocks, but there are only 2 available. So he checks if he can build the missing two blocks and he find that there a 8 raw resources available, so he build the two blocks and then when he has 4 blocks he is able to build the wall. Right now it's a basic AI but it already supports recursive building, checking for materials available, and also multiple guy working on the same job without creating a mess.
   •   Other than that the game also has the blueprint system and a menu to place the discovered blocks:


   •   Last but not least I also implemented serialization to have basic saving and loading.

What's the plan now?
The plan is to work full time on it and record myself working everytime I can, so everyday I should be able to post on Youtube a timelapse video (first one is already available here https://www.youtube.com/channel/UC2l3kcw6wUn4Z1-cr5UMLMw ) showing roughly the progress and with a public changelog made with Google Spreadsheet anyone can see exactly what I did that day. This should help others keep track of the project as well as helping me working seriously and clean.

Contacts
So, if you are curious to see how things will go feel free click any of these links:
Discord Server: https://discord.gg/mSCn4BU
YouTube channel for Timelapses: https://www.youtube.com/channel/UC2l3kcw6wUn4Z1-cr5UMLMw
Twitter: https://twitter.com/ElkiwyDev
Changelog: https://docs.google.com/spreadsheets/d/1kVIHUpf0jC8NFg5rxJF_hiWDkw-0VWnMI-Au4op0MiQ/edit?usp=sharing
« Last Edit: January 14, 2018, 02:44:53 AM by ElkiwyDev » Logged

Follow me and Project_BuildTutto by clicking any of these links: Discord Server: https://discord.gg/mSCn4BUYouTube channel for Timelapses: https://www.youtube.com/channel/UC2l3kcw6wUn4Z1-cr5UMLMw
ElkiwyDev
Level 0
***


View Profile
« Reply #1 on: November 10, 2017, 06:41:11 AM »

Hello everyone!
Stefano here, it's been a great working week for Project_BuildTutto and I'm so much excited with how it is growing quickly that I can't wait to share the progress I made!
First of all here you can find Monday, Tuesday, Wednesday, and Thursday timelapse videos. I still want to improve them and I would like to add some background music and some caption to explain to the viewer what is watching, hopefully I'll be able to do that for the future videos.


Here you can also see the changelog relative to those days in the timelapses:



So, let's talk a bit more in depth of the major changes this week:


Job sharing between guys
This was a feature already in the project the past week but on Monday I managed to improve it and make it more reliable. The jobs/orders are a crucial point to the game and I took particular care in this part because I wanted to make that structure robust. The jobs are created from a controller object (Level) and are organized in a tree-like graph, where the root of the tree is the final order and each node child is an order that have to be completed before taking care of that node parent. I did it this way because Guys can then ask the controller object to get a random leaf(a node without any child) from the tree and begin to execute it without stealing jobs to other guys or without taking an order that still has some work to be done before completing it.


Item stacking
On Monday I also managed to fit in the implementation of proper item stacking. Previously if you tried to place an object on the same tile it would have simply create a new instance overlapping the previous one, but this method was crazy ugly and totally inefficient. Now if you try to place an item in a tile where there is already another item with the same ID the object there, first it'll add to his internal stack counter one and then it'll delete the new one. This way if you have a stack of 1000 item you will still have one single object with a stack value of 1000, instead of 1000 objects with 1 item each. This approach complicated few things a little bit, like object reservation and the creation of the orders tree, but now it should be all working correctly again.


Weights and properties to objects with .CSV and Google Spreadsheet

The main idea of the game is that you will be able to build everything starting always from basic raw resources. So these resources need to have tons of properties and detail to define their behavior. So on Tuesday I added a pretty handy system to manage all this information and fill it in the game. In fact I made a sheet on Google Spreadsheet where I'll store a table with all this data, then I'll export this table as a commas-separated-value file (.csv) and feed this file in the game through a function that will parse the file and create a 2D vector of all this information. Then I'll use these 2D vector to create a map of all this information to be able to quickly and simply access to any information I need by simply asking the game controller to get the value of the map at *object_material* + "_" + *property_I_want* (ex: "iron_weight").


|
V

|
V

Guy's ability to change the orders tree to simplify or improve efficiency of orders
With the weights and item stacking done, I wanted to limit the maximum lifting weight to guys to 50kg. So now if there is an order to get 8 pieces of iron (10kg each) the guy will not be able to grab them all, but instead will callback the controller object in order to change the build tree and make it easier for him. The build tree will split the nodes relative to that job creating 1 new grab node and 1 new place order. So instead of grab8 and place8 there will be grab5, place5, then grab3 and place3. In this way the Guy will be able to complete the job.




Another change similar to this one is the Node joining. Basically it's the opposite of the previous one. <br />In this case there is a Guy (that can lift 50kg) and 4 grab orders of one piece of iron each in different location of the grid. Before, the guy would take one, place one, take other one, place that, etc... But now with node joining the guy can recognize that grabbing a single piece of iron is an easy job for him and it could take more, so he callback again the controller object asking if there are other grab orders similar to the one he is doing now. In this case the controller will modify the tree joining nodes so the guy can then grab all the resource he needs one after the other, stacking them in the object he already have, and then place all 4 piece in a single place order.



Guys helping each other to lift heavy weights
Another cool features made possible with weights is the ability from the guy to call help to lift something. For example if there is a single item that weights 70kg, and this item need to be grabbed and placed somewhere in the map, that job cannot be completed from a single guy. So when a Guy take that order, he recognize that the item is too heavy for him, and he search if there is another guy nearby. If there is another guy, he will call him to help and they will both go at the item location and grab it together. This feature supports up to 5 guys helping each other to lift a 250kg object.



Ability to choose which save file to load in-game
Lastly, I changed the "load" button. Before it was loading the last savefile done, now it will prompt the user a list of all the save file he find in the "saves" directory of the game giving the user the power of choosing which file to load. This features come particularly useful in this state of the development since there are many "scenes" that need to be tested any time I add a new feature that could break them.


Keep in touch
If you are curious to see how things will go feel free click any of these links to join our community:
Discord Server: https://discord.gg/mSCn4BU
YouTube channel for Timelapses: https://www.youtube.com/channel/UC2l3kcw6wUn4Z1-cr5UMLMw
Twitter: https://twitter.com/ElkiwyDev
Changelog: https://docs.google.com/spreadsheets/d/1kVIHUpf0jC8NFg5rxJF_hiWDkw-0VWnMI-Au4op0MiQ/edit?usp=sharing
Logged

Follow me and Project_BuildTutto by clicking any of these links: Discord Server: https://discord.gg/mSCn4BUYouTube channel for Timelapses: https://www.youtube.com/channel/UC2l3kcw6wUn4Z1-cr5UMLMw
ElkiwyDev
Level 0
***


View Profile
« Reply #2 on: November 17, 2017, 08:14:08 AM »

Hello everyone!
Stefano here with the third Project_BuildTutto update!
Again, a lot of new features this week, but first, here are this week's timelapse videos (I forgot to record monday's video Sad )


Here is the changelog of this week:


Added Chest object and "store item" job
Having multiple resource objects all over the floor was a bit ugly and I wanted to have a rough storage system at this stage of the game. In the final game there will be much more complex storages, but for now a chest was good enough.
With the new chest object I also added the "store item" order type for guys, so if they are not building anything they will clean up the floor and store items around in the nearest not full chest on the map. When an object is stored inside the chest, guys will be able to take that item off the chest and use it to build something when needed.



I also made the chest's sprites but I'll add them in the game next week:


New grass/dirt terrain
The game now finally have a background! Bye bye old black void and hello grass and dirt!


Some tiles are still a bit rough and need some polish but I already like this first iteration of the tileset very much.
At the moment the terrain has no interaction with guys and items in the game but I'm planning to integrate it in the game with few mechanics.


Coding all 47 tiles autotiling has been a little nightmare but at the end I managed to make it work decently after some failures.

Added GUI TextBoxes and NumberBoxes
The terrain took me much more time than what I'd like to admit, but on the other hand TextBoxes and NumberBoxes took me way less time than what I thought when I planned out this feature.
The GUI system is custom made, and this means that I wrote it entirely from scratch and I would like to talk about it deeply on how it works but I would make this article too long, instead I'll do an article only on that in the future.
Having a custom GUI also means that I have to write all the pieces that make up the GUI, like buttons, text, sliders, images, scrollable lists, textboxes, etc... This week I added the TextBoxes because I wanted to give the user the possibility to choose a name for the save file, and that required that the user should be able to type somewhere in the game.


"Buy resources" menu
This feature is a leap forward in the development, since buying raw resources is a key element to progress in the game. This menu will give the player an interface where he can select which raw resource to buy.


After he select which one he wants to buy the game will prompt the player with another menu asking him how many resource wants.


This sub menu has been possible to make thanks to the number boxes (variant of the text boxes). Thanks to the number boxes I was also able to make both the user input type the exact number he wants or press the buttons to increment/decrement the current quantity selected.


NB: This features is only about *the buy resources menu*, I still have to code the actual action of buying resource and the delivering of those resources in the game to the player.

Box selection
Another pretty cool thing is the box selection. First the player was able to select one tile and do some debug action with that single object like destroying it or installing it. Now he can do the same thing but with multiple objects instead of one by one! This feature will be more useful later on in the development when the player will have the chance to make multiple orders for the guys or selecting multiple objects to compare them.


Keep in touch
If you are curious to see how things will go feel free click any of these links to join our community:
Discord Server: https://discord.gg/mSCn4BU
YouTube channel for Timelapses: https://www.youtube.com/channel/UC2l3kcw6wUn4Z1-cr5UMLMw
Twitter: https://twitter.com/ElkiwyDev
Changelog: https://docs.google.com/spreadsheets/d/1kVIHUpf0jC8NFg5rxJF_hiWDkw-0VWnMI-Au4op0MiQ/edit?usp=sharing
Logged

Follow me and Project_BuildTutto by clicking any of these links: Discord Server: https://discord.gg/mSCn4BUYouTube channel for Timelapses: https://www.youtube.com/channel/UC2l3kcw6wUn4Z1-cr5UMLMw
ElkiwyDev
Level 0
***


View Profile
« Reply #3 on: November 24, 2017, 05:46:23 AM »

Hello everyone!
Stefano here, and this is the fourth Project_BuildTutto Update!
As always, lot of progress this weeks so here you have the timelapses:


Here is the changelog of this week:


Completed "Buy Resources" menu
Last week I wrote about the buy resource menu, but this week I was able to finish it including all the functionality and being able to finally buy some resources!

I reworked the layout of the menu because previous one didn't support multiple items order enough. Now you have a single menu with a scrollable list of items, and on the side of each one you have the controls to input how many of them you want to buy.



Roads and transportation trucks
With the buy resource menu in place I was able to add a road to place trucks that will carry all the items you buy. The trucks behavior right now is pretty simple:

-You buy an item
-A truck spawns with that item
-The truck will stop at the designated offloading location
-The game will create an order tree to let Guys take care of the offloading process
-When the truck will be empty it will leave the map.


(There are a graphical bug that draws the item sprite two times but that will be solved in the next update)

Each truck will be able to carry 4 stacks of 500 items for a total maximum of 2000 items. If your order is greater than that there will be more than one trucks waiting in a queue.

NB: obviously both roads and trucks sprites are temporary, next week I should be able to work on that.


Door and Floor objects
Walls without doors are pretty much useless if you want to build buildings, so I finally added them. Now you are able to build a somewhat decent structure complete of all the comforts!

Doors currently automatically open up when a guy has to pass through with no slows down for him, but the plan is to add an open/close time based on the weight of the material you used to build the door.



Indoors and room mapping
Now that the game has both walls and doors, it was time to add the room mapping. This means that the game is able to recognize what tiles are part of a certain room and what tiles are outdoor or indoor.

To do that I used a floodfill algorithm on the 2D matrix used to track down all the solid objects currently in the game.


This feature right now has no real impact on the game, but it will be extremely useful when I'll have to implement the light system and the room designation system.


Upgraded blueprint crafting grid from 3x3 to 7x7
This was a minor change because thanks to some good planned code I only had to change the parameter passed to the constructor function and everything worked out correctly.


But with this change I plan to expand the complexity of the build patterns to allow the construction of bigger and more detailed object.


Cache-like system to optimize ghosts build conditions checking
I usually don't write about optimizations or fixes here but I'm particularly proud of this one so here you have it.

When I was testing the scene showed in the image below, I noticed that the controller object, that has to do all the checking to see if a ghost object can be built or not, was taking significant amount of processing time. Then I saw that for each ghost object I was calculating a lot of things because I had to fall back recursively to its building parts, and if I had no building parts available I also checked if I could build those.
There was clearly a lot of work to be done for each ghost, but the main problem was that if it wasn't able to build the first wall, it was useless to check for all the other walls, because those were exactly the same as the previous one.


So, I added a cache-like system to save all the items that I for sure can't build in that frame and it works approximately like this:



Keep in touch
If you are curious to see how things will go feel free click any of these links to join our community:
Discord Server: https://discord.gg/mSCn4BU
YouTube channel for Timelapses: https://www.youtube.com/channel/UC2l3kcw6wUn4Z1-cr5UMLMw
Twitter: https://twitter.com/ElkiwyDev
Changelog: https://docs.google.com/spreadsheets/d/1kVIHUpf0jC8NFg5rxJF_hiWDkw-0VWnMI-Au4op0MiQ/edit?usp=sharing
Logged

Follow me and Project_BuildTutto by clicking any of these links: Discord Server: https://discord.gg/mSCn4BUYouTube channel for Timelapses: https://www.youtube.com/channel/UC2l3kcw6wUn4Z1-cr5UMLMw
ElkiwyDev
Level 0
***


View Profile
« Reply #4 on: December 01, 2017, 05:29:24 AM »

Hello everyone!
Stefano here, and welcome to the fifth Project_BuildTutto Update!
This week's changes might seems fewer than the past weeks, but that's because I had to change a lot of stuff in the code to add the complexity level required by the introduction of the furnace object to give me better times when I'll need to add other "processing" objects. So here you have the videos and the changelog so then we can dive into the major changes!



Fire related properties to resources
This week's work started with a lot of researching and a lot of wikipedia. In fact I had to add to every resource some properties related to fire like:
   -melting temperature, to know how much heat a furnace should produce to melt a certain material
   -ignition temperature, to know how resistant can be a wood wall if it's near a source of heat
   -flame temperature, to know how much heat a furnace can produce when at work
   -burnup time, to know for how much a furnace can burn a certain material to produce heat


All this information at the moment are somewhat real but with some changes to make the game playable, you can see all this information in the third sheet in the Google spreadsheet changelog.

Furnace and Ingots objects
With all these new properties to play around I started to code the first material processing tool of the game, the classic furnace object. This will be useful to produce a lot of cool stuff in the game, but for now it will just produce basic ingots.
This took a lot of time to code completly because it required many changes to the code structure of guy's orders and item recipes.

I had to change the nodes of the order trees


and I also had to change the recipes of the items


These two changes required a lot of changes here and there in the code since those were a fundamental structure of the whole game.

So the final guy workflow when building something with the furnace will be something like this:




Changes to blueprint menu
The introduction of the new processing tool required some changes in the blueprint menu too because I needed to add something to tell to the system where the input items should be processed.
This problem was solved by introducing to my custom GUI system the "radio buttons" object type. Radio buttons are a famous gui element that consist in a list of buttons where you can only choose one of them at the time. This kind of object was perfect for my problem because it allowed me to add this toggle below the crafting grid and add a button for every processing tool I have, so in this way the system will always check what tool is currently selected and react according to it.


Minor quality of life changes
This week I had time to add some minor code to make the life of the player a little bit easier when doing certain type of things. For example I added the possibility to hold the click when placing a ghost and drag the mouse around to place multiple ghosts easier.


I added something similar to the blueprint menu too so you can drag to place multiple items.


And some other minor changes like the ability to delete ghosts and debug items autoinstallation.

Keep in touch
If you are curious to see how things will go feel free click any of these links to join our community:
Discord Server: https://discord.gg/mSCn4BU
YouTube channel for Timelapses: https://www.youtube.com/channel/UC2l3kcw6wUn4Z1-cr5UMLMw
Twitter: https://twitter.com/ElkiwyDev
Changelog: https://docs.google.com/spreadsheets/d/1kVIHUpf0jC8NFg5rxJF_hiWDkw-0VWnMI-Au4op0MiQ/edit?usp=sharing
Logged

Follow me and Project_BuildTutto by clicking any of these links: Discord Server: https://discord.gg/mSCn4BUYouTube channel for Timelapses: https://www.youtube.com/channel/UC2l3kcw6wUn4Z1-cr5UMLMw
ElkiwyDev
Level 0
***


View Profile
« Reply #5 on: December 08, 2017, 05:51:47 AM »

Hello everyone!
Stefano here with a brand new update!
There is a bunch of new cool stuff, new sprites, and even new python scripts!
So let me throw at you the timelapse videos and the changelog first, so we can let's dive in the changes right after!





New sprites
The first thing that we can see in this week's update is that some sprites have been changed and some have been added.
In the specific I changed for the third time already the terrain tiles (still not satisfied with that) and the road sprites (previously were only placeholders anyway). The camion sprite has been added and I'm very happy about how it looks. The furnace now has a sprite too, mixed feelings about that. This week I also added a lot of new objects and few more material types so I added sprites even for those.
Lastly I added sprites to the gui windows too, and I'm very very happy how those looks because are simple but effective.







Python scripts
The art side of the game keeps getting more and more complex to manage. In fact every time I add a new object I have to draw every materials variants for it, and everytime I add a new material I have to draw all the objects with that material to keep everything updated. So, I'm still thinking a way to automate a little the creation process of that thing, but for now that is all manual work. What I did automate is the exporting process to all the different sprite to load into the game.

I work with Krita and Gimp to create the sprites for the game and previously I drawed everything in a generic .kra file (like a .psd) with different layers, and when I needed to export that drawing I had to crop the image into a 64x64 containing that sprite, export as a .png, name it as the resource it represent, undo the cropping, and repeat that process for every sprite. That work was so tedious and slow that forced me to learn python and create a script capable of speed up that thing... And that surprisingly was super easy!

Now what I have is a .kra file with many layers and layer groups. Each layer group hold a item type (like block, wall, furnace, ecc) and in each group there are different layers: one for the black borders of the item(named "b"), one for the shading of that item(named "s"), and N layers one for every material in the game(named "ci" for iron, "cs" for sand, "cc" for copper, etc...).


I then save that file as a .psd and the python script parse all that and create all the different images by saving for each group the border and shade layer, merging them together, and merge that with the different materials layer. In this way the script can generate and save automatically all the images with the correct names saving me a lot of time.


Other than that I also created a python script to speed up the terrain making process by creating 1 image made of 48 different tiles starting from just one .psd file with 4 layers.



New resources, processing machines, and objects

Two new materials are now available: copper and sand. I added specifically this two materials because I wanted to prepare the road to have the first complex item which is a lamp, made with a light bulb, which is made by copper filaments and glass.


To be able to create those filaments the guys will have to go through a pretty complex processing path:


All those new items and machines as been added this week in the game.


Special blueprints
To be able to create glass material the player will have to create a special blueprint that can be discovered by placing raw sand in a furnace. In this way the player will be able to choose between the standard output of that blueprint or the special one which consist in obtaining raw glass.


Keep in touch
If you are curious to see how things will go feel free click any of these links to join our community:
Discord Server: https://discord.gg/mSCn4BU
YouTube channel for Timelapses: https://www.youtube.com/channel/UC2l3kcw6wUn4Z1-cr5UMLMw
Twitter: https://twitter.com/ElkiwyDev
Changelog: https://docs.google.com/spreadsheets/d/1kVIHUpf0jC8NFg5rxJF_hiWDkw-0VWnMI-Au4op0MiQ/edit?usp=sharing
Logged

Follow me and Project_BuildTutto by clicking any of these links: Discord Server: https://discord.gg/mSCn4BUYouTube channel for Timelapses: https://www.youtube.com/channel/UC2l3kcw6wUn4Z1-cr5UMLMw
ElkiwyDev
Level 0
***


View Profile
« Reply #6 on: December 15, 2017, 01:58:15 AM »

Hello everyone!
Stefano here, writing about yet another update!
Not too much going on this week on the "new features" aspect of the development but a lot of stuff was changed behind the scenes. In fact I took a whole week to deeply test and debug all the features that were added in the past weeks to be sure enough that the game until now is stable. I didn't wanted to record boring debugging session because I thought that the finally timelapse would have been too messy and not very comprehensible, this is why I only uploaded one art timelapse this week and here it is:





As always, here is the changelog too:



Complete testing and debugging
This is what took the major part of this week. Every features is tested when it's added to the game, but even the smallest change somewhere in the code could lead to a crash somewhere else where you don't expect that, so it's always a good thing to stop the development process for a bit and just focus on testing and make sure that everything is ok before making it even more complex and messy.

Here is the main test I ran (obviously they were not all "ok" in the first run of the test, I marked them "ok" only after I fixed them):


I also took advantage of the save system through the serialization of the game objects to take snapshots of the states of the game objects in various situation, and then I compared those snapshots in a diff checking program to see if there were unexpected differences. These were the test I did with this method:



Improved Save and Load functions
One thing that it has been a bit of a pain to deal with is the save system. Before it worked all nice and correctly when the scene was static, but it didn't support scenes where guys were working on something because orders serialization was not implemented yet.
Now after a bit of spaghetti code later it all work nicely even with complex scenes and guys working on multiple things.



New Sprites
Even if it was debugging week I still had a lot of images to do since last week I added many new objects to the game. So I took some time to do the continuous caster sprite, the roller machine sprite, and the rod sprite. I also finally decided that the majority of the game's sprites will be full top down (except some few special sprites like guys) because I like that style more, so I may have to redo some sprite to fit that style better.



Keep in touch
If you are curious to see how things will go feel free click any of these links to join our community:
Discord Server: https://discord.gg/mSCn4BU
YouTube channel for Timelapses: https://www.youtube.com/channel/UC2l3kcw6wUn4Z1-cr5UMLMw
Twitter: https://twitter.com/ElkiwyDev
Changelog: https://docs.google.com/spreadsheets/d/1kVIHUpf0jC8NFg5rxJF_hiWDkw-0VWnMI-Au4op0MiQ/edit?usp=sharing
Logged

Follow me and Project_BuildTutto by clicking any of these links: Discord Server: https://discord.gg/mSCn4BUYouTube channel for Timelapses: https://www.youtube.com/channel/UC2l3kcw6wUn4Z1-cr5UMLMw
ElkiwyDev
Level 0
***


View Profile
« Reply #7 on: December 22, 2017, 06:58:34 AM »

Hello everyone!
Stefano here with another update!
This week was a rough one for me, Tuesday I was very sick with a lot of messy things that I would like to not talk about it. Anyway, even if on that day I didn't even turned on the PC, Monday has been a very productive day so it compensated a bit.
I recorded only Monday and Wednesday so here you have the videos:








And here is the changelog:



Electrical Grid: Generators and Cables
So, the goal for this week was to make a stable and decently working electrical grid to be able to manage all the machines that will depend on electricity. To do this there is a new "management object" called ElectricGrid. This object will be the coordinator of a single connected grid of electrical components (There could be more than one if there are two grids that are not connected with each other).
The ElectricGrid has 3 types of objects:
-Sources: objects like generators which will generate electricity and will input that into the electric grid
-Cables: objects that will provide electricity to any component connected to them
-Machines: objects that will consume electricity to work.


ElectricGrid are capable to merge with another grid to create a single bigger grid, but also split into different grids if the player removes an object that serve as a bridge between two part of the grid.




New sprites
The day after the sickness I was able to draw some sprites while I was feeling better, so I drew the generators, plates, and fineplates sprites. I also tried to draw some decent cables sprites but after realizing that I had to make 16 different sprites for each materials I opted to draw some placeholders and focus on the implementation of those sprites.



Keep in touch
If you are curious to see how things will go feel free click any of these links to join our community:
Discord Server: https://discord.gg/mSCn4BU
YouTube channel for Timelapses: https://www.youtube.com/channel/UC2l3kcw6wUn4Z1-cr5UMLMw
Twitter: https://twitter.com/ElkiwyDev
Changelog: https://docs.google.com/spreadsheets/d/1kVIHUpf0jC8NFg5rxJF_hiWDkw-0VWnMI-Au4op0MiQ/edit?usp=sharing
Logged

Follow me and Project_BuildTutto by clicking any of these links: Discord Server: https://discord.gg/mSCn4BUYouTube channel for Timelapses: https://www.youtube.com/channel/UC2l3kcw6wUn4Z1-cr5UMLMw
ElkiwyDev
Level 0
***


View Profile
« Reply #8 on: January 12, 2018, 06:08:57 AM »

Hello everyone!

Stefano here. Man,it's been a while since the last update! Many things has changed and many new things are appeared, so let's dive in in the changelog straightaway!

But before that, here is all the timelapse videos of this week:



During the holidays I didn't record myself coding because I didn't worked regularly, that's way most of that work isn't recorded.

Fully automated electric workflow with electric machines
In the previous update I wrote about electric cables and generator, but this time those things actually are useful in the game, because now the game has machine that suck all that juicy electricity to work! Machines like the Roller and the Die Drawer now needs electricity to work, if they do not have electricity the guy will try to work on those but then it will get stuck and abandon that job until the machine will have electricity (more on stuck jobs later). Also, the process of working on an electric machine is fully automated if you plan out the right setup, because guys are now able to check if a generator is fully charged or not, if it could feed more electricity in a grid but it lacks of fuel a guy will be scheduled to grab some fuel and feed it to the machine in order to maintain a high electric charge in the grid.


Electric Conductivity of materials
Raw materials have now the Electrical conductivity property. Based on that electric components made of different materials will act differently and will have different stats. For example a cable made of iron will have a maximum capacity of 100 electric units and will output at a rate of 1 unit per frame, while a cable made of copper (which has a much higher electrical capacity) will be able to store up to 700 units and output at a rate of 7 units per frame. This will have an impact on how the game work because for example 1 unit per frame isn't enough to feed a roller machine which need an input of 3 units per frame while it works, so the machine will work slowly if connected to an iron cable instead of a copper one. PS:Making an electrical cable with wood isn't a great idea since it has no electrical conductivity, but you can still do it if you really want it


Stuck jobs recognition
Let's keep making the order's data structure more and more complex! Yay! Since the game is growing I keep finding faults while I test the game which leads to improvement on the main structures of the game in order to allow me to fix all that crap. This week I had to face the problem that my previous structure didn't support the fact that sometimes a job can't be done straightaway but it needs to wait for another job to be done.


To fix that I had to pair to each order tree a number which will tell to the system if that tree is currently stuck or not, and if it's stuck the system can check why it's stuck (based on which number it reads) and try to see if that could be unstuck now or if it has to remain stuck a bit more time.
The system now support the following condition:
    -NOT STUCK: the tree is not stuck
    -STUCK_NOELECTRICITY: the tree has one or more machine that doesn't have electricity to work.
        -Is triggered when a guy tries to work on a machine and see that doesn't work.
       -Is resolved when all the machines in the tree has more than a threshold of electricity stored.
   -STUCK_MACHINEBUSY: the tree has one or more machine currently busy.
       -Is triggered before a guy tries to grab an item to place it in a machine which is busy.
       -Is resolved when all the machines in the tree are not busy (it also check if there is more than one machine to do the job and tries to replace the old busy machine with another machine which is not busy)


Lights renderer and subtle effects
Since this week was the first week after the holidays I wanted it to be a good one and I took some time to add some spice to the game with few small graphical effects. The first obvious one is the presence of a light system to manage lights emitted from lamps and other future objects. This system will be remade partially next week because now it works with tiles but I don't like the results and it's not much scalable to bigger lights, so next week I'll remade it with raycasting to have a nicer effect.

(Yellow = light source, Red = wall object, White = lit area, Black = dark area)

Light will depend on the time in-game (day/night cycle will come next) and if a current spot is indoor or not to force players to take particular care of the lights inside their factories.
A more subtle light effect is a moving fog layer before every object in the game. It's a very soft effect but in my opinion it makes the scene a little bit more interesting graphically and reduces the "identical tiles" effects when a lot of tiles are repeated.


New Sprites
As always, a lot of new objects in the game and a lot of new sprites are done.
-Cables have their own non-placeholder sprites.
-Walls are now tilable with nearby walls just like cables.
-DieDrawer, wires, filaments, lightbulb, lamps have now their sprite
-Furnace sprites as been remade to fit the current "all the machines have full top down view" style


Keep in touch
If you are curious to see how things will go feel free click any of these links to join our community:
Discord Server: https://discord.gg/mSCn4BU
YouTube channel for Timelapses: https://www.youtube.com/channel/UC2l3kcw6wUn4Z1-cr5UMLMw
Twitter: https://twitter.com/ElkiwyDev
Changelog: https://docs.google.com/spreadsheets/d/1kVIHUpf0jC8NFg5rxJF_hiWDkw-0VWnMI-Au4op0MiQ/edit?usp=sharing

Logged

Follow me and Project_BuildTutto by clicking any of these links: Discord Server: https://discord.gg/mSCn4BUYouTube channel for Timelapses: https://www.youtube.com/channel/UC2l3kcw6wUn4Z1-cr5UMLMw
ElkiwyDev
Level 0
***


View Profile
« Reply #9 on: January 19, 2018, 06:08:21 AM »

Hello everyone!
Stefano here with yet another Project_BuildTutto update!
This week was planned as a "Redo some stuff and test everything" so nothing very exciting at start, but it did turn out as a good and fun week with some cool stuff here and there.

As always, here are the timelapses and the full changelog:



Unique object's IDs
The main goal of the week was to redo the light system with raycasting, but after thinking a bit during the weekend I had to face it: the old ID system was not good enough to handle the complexity level reached from the current state of the game.
Since every object in the game is made out of something else starting always from raw resources, every blueprinted objects has to have an ID able to describe the object and tell to everything else in the game what is it and what material is made of.
Before, IDs were like : *category of the object* + "_" + *material of the object*. So if a block was made of raw iron, its ID was "block_iron", and if you would use those blocks to build a wall, the wall ID would have been "wall_iron", since the blocks were made of iron.
That system was "good enough" for the blocks and wall example, but not enough for objects like the continuous caster which was something like this:


That kinda worked because when I built the furnace, its properties were already inherited from its materials so there was no real need to knowing what was made of to get its behavior. When a contcaster was made, it would inherit everything from the furnace and still work just fine.

The problem was: "raw_B" define how much heat the furnace can output in order to melt materials, so it's a key element to both furnace and contcaster, but it's not present in their IDs. So if the player would blueprint two different furnaces, one made of iron-wood and one made of iron-coal the resulting two furnaces would have the same ID. And that would create big problems in the crafting system since the algorithm could not distinguish which furnace is requested from the ID only.

Getting rid entirely of the old is wasn’t ideal, since it's a handy little string that gives me easy access of what an object is and what sprite assign to it. But I clearly needed to add more information to objects.

The solution was to keep the old id for non-crucial task, and add a "uniqueID" to the objects in a JSONarray-like structure like such:

[*category of the object*, [*uniqueID of ingredient1*, *uniqueID of ingredient2(if any)*, *uniqueID of ingredient3(if any)*,...]]

So, to make it clear here are some kind of uniqueIDs:


so with that, if I have two different furnaces and contcaster, I’d have two different uniqueIDs describing those, and the recursive nature of it is ideal to get the exacts IDs of the components deep as I want during the crafting system.



Improved light system with raycasting
Ok, after that big one done here is time to turn up the lights.
As wrote in the previous update, the lights i made last week weren't good enough for me, so I re-made part of it and implemented raycasting.

After getting through some of this:


...and some of this:


I got something like this:


What I didn't wanted was something that could take too much performance for such a non-crucial task, so I tried to design it as efficient as i could. What come out is an almost-dynamic-but-not-in-realtime light system which plays a lot with sprites and blending.
It works something like this:


In this way I only need to make all the calculus when I spawn a light source, or when i place some solid objects like a wall nearby a light source. In all the other "normal" frame the light already has the right custom sprite in memory and the only thing it needs to do is draw it.



Improved objects rendering with camera movements and scaling
Another important thing to do was to work on the camera rendering, since it worked only when the camera was at the default position and it was at the default zoom level.
An important performance thing to always keep in mind is: "drawing is hard, so don't take that much effort to draw something if the player won’t see it".
In fact, if I tell to the game "draw this sprite offscreen" the computer will still have to work to draw that but the user will not see it, effectively taking resources for no reason at all.
That thing is a crucial performance key when coding a tile based game with levels bigger than the normal camera view, since I always have to calculate what the player can see and what he can't, and adjust the rendering as such.




GUI console and improved scrollable list rendering
Lastly, yesterday I finished the goal for the week, and while I was testing out stuff in the game I thought "Right, a potential player can't see the debug console in the terminal to understand what is going on in the game... I have to do something about it".
So I designed and coded a custom console log to let the game communicate to the player.
I wanted something well made and scalable so I took particular care in making it.
The final result looks like this:


From anywhere in the game I can tell the console to add a new message with a specific color and a specific lifespan before fading out. In any moment the player can scroll the log showing all the messages printed previously with a custom maximum backlog of 100 messages.

Keep in touch
If you are curious to see how things will go feel free click any of these links to join our community:
Discord Server: https://discord.gg/mSCn4BU
YouTube channel for Timelapses: https://www.youtube.com/channel/UC2l3kcw6wUn4Z1-cr5UMLMw
Twitter: https://twitter.com/ElkiwyDev
Changelog: https://docs.google.com/spreadsheets/d/1kVIHUpf0jC8NFg5rxJF_hiWDkw-0VWnMI-Au4op0MiQ/edit?usp=sharing
Logged

Follow me and Project_BuildTutto by clicking any of these links: Discord Server: https://discord.gg/mSCn4BUYouTube channel for Timelapses: https://www.youtube.com/channel/UC2l3kcw6wUn4Z1-cr5UMLMw
ElkiwyDev
Level 0
***


View Profile
« Reply #10 on: January 26, 2018, 06:43:55 AM »

Hello everyone!
Stefano here, and this is Project_BuildTutto eleventh update!
I'm exited for this one because the past weekend I decided to shift all the working schedule by a week since I wanted to work on the rest of the resource/objects types (like fluids and chemicals) before adding the pipes and all the object to manage that stuff in-game. But, surprisingly, I was able to add all that stuff on Monday, giving me all the rest of the week to work on the pipes and liquids handling system like it was planned to be in the first place. On the other side, on that system there is much more work than what I was planned so I'll be working on that next week too... But hey, life of a developer, I guess.

Like every week, here are the timelapses and the changelog:





3 New object classes: Alloys, Liquids, and Chemicals
In the changelog you will see a lot the word "OALC", which is an acronym for Objects, Alloys, Liquids, and Chemicals. When you see that it means that I was working on something which involved all these different resources types.

  • Objects: These are the classic ones, like raw_iron/raw_wood and all the objects made from those.
  • Alloys: These are a bit different, every time you will make an ingot (object) of some material it will appear in the alloy tab. There you will be able to mix those ingots trying to make new materials from that. For example you'll be able to obtain bronze by mixing copper and tin ingots. When you will discover bronze you will be able to craft it and make objects of that material instead of limiting the player with only the raw resource that he will able to buy.
  • Liquids: These will be needed to some machines to be able to work, and will be managed by the pipes system (more on that later). The player will be able to mix them creating solutions and other stuff like he’ll do with alloys.
  • Chemicals: I still have to think about this but the main idea is that those will be mainly gasses and will be handled by the liquid pipe system. Can be combined too.

With all these new stuff some menus have been restyled, in particular the blueprint menu now has different tabs for the different resources and the buy resource menu has alloys, liquids, and chemicals in its scrollable list.

Since the solids and liquids management is deeply different, two different resources trucks are now in the game: one for solid objects and one for liquids and chemicals.
This last truck type will require no guy to offload but it will automatically connects to a pipe nearby and will starts to offload its content in the pipe.



Liquids handling: Pipes, pumps, and tanks
The liquid handling system at the moments counts of 3 different objects: Pipes, Pumps, and Tanks.

  • Pipes are the obvious basic piece of every liquid system. They take one tile of space and automagically connects to any pipe, pump, or tank near them. They *should* hold one liquid type at the time. I wrote "should" because they *can* hold one or more liquid type, but if that will happen the liquids will mix together obtaining liquid waste and that will be something you will not want to happen. To avoid that liquid waste thing the player will have to design carefully all the system with pumps and filter pipes (the latter isn't implemented yet)
  • Pumps are also pretty self-explanatory. Pipes will always try to balance liquids between them and their other connected pipes, Pumps will always try to push all their liquid and the one from their input side into their other connected pipes. These objects will be pretty useful to be sure to empty one pipes section before pulling in a different fluid type in order to avoid the liquid waste. Pumps will be also useful to pump liquids into Tanks, since a normal pipe doesn't have enough pressure to fill it up completly.
  • Tanks are big 2x2 tiles objects which will capable to store big quantity of liquids. Can connect to pipes in any of their side. Not much more to say here.


With these basic objects type a somewhat decent liquids system can be made, but I plan to add more stuff to improve the usability of these system and to deeply expand its mechanics.
There will be also a Controller class called LiquidController (WIP in this moment) which will manage all the pipes and will divide them into sections to have an easier control about the whole system that the player will design.


Just like cables have their electrical view, Pipes have now a "Liquids View" mode where the game will highlights all the pipes related object and show more information about them.




Small gui optimization
Between all the big features I always work on smaller thing when I encounter them. Lately I discovered the beauty of al_create_bitmap function and that showed me many ways to optimize my code here and there.
Specifically, in the window class previously I was drawing them by drawing 9 different scaled bitmaps each frame.


I was doing that because I wanted to be able to make windows of any size, and that system made me able to do it by stretching the borders of all the extra pixel I needed. But I was still drawing 9 different scaled bitmaps each frame. With al_create_bitmap I'm able to create a custom bitmap each time I create a new window with something like that:

  • Create the new bitmap of the needed size
  • Move the drawing target to the new bitmap instead of the screen buffer
  • Draw the 9 bitmaps with the right scale inside the new bitmap one time
  • Move the drawing target to the screen buffer again

at the end of that process I have a single new bitmap of the exact size I needed and with the exact effect like before. The major difference is that now I only have to only draw that single bitmap without any scaling and the cpu is ready to move on other stuff.



Keep in touch
If you are curious to see how things will go feel free click any of these links to join our community:
Discord Server: https://discord.gg/mSCn4BU
YouTube channel for Timelapses: https://www.youtube.com/channel/UC2l3kcw6wUn4Z1-cr5UMLMw
Twitter: https://twitter.com/ElkiwyDev
Changelog: https://docs.google.com/spreadsheets/d/1kVIHUpf0jC8NFg5rxJF_hiWDkw-0VWnMI-Au4op0MiQ/edit?usp=sharing
Logged

Follow me and Project_BuildTutto by clicking any of these links: Discord Server: https://discord.gg/mSCn4BUYouTube channel for Timelapses: https://www.youtube.com/channel/UC2l3kcw6wUn4Z1-cr5UMLMw
ElkiwyDev
Level 0
***


View Profile
« Reply #11 on: February 02, 2018, 02:42:34 AM »

Hello everyone!
Stefano here with another Project_BuildTutto Update!
This week is a sort of "Part 2" of previous week since I kept working on the liquid system and completed some work left to be done.
Here you have as always the timelapses and the changelog (Forgot to record on Monday and thrown away in anger Thursday's video because nothing cool as been done, only bug tryharding).









As a new thing, here is a small "stats recap" of this week. I’ll keep doing this in the next updates so let me know what you think about it!




LiquidController sections

Like cables have ElectricalGrid class to manage all their connections, Pipes have the LiquidController class to manage all their behavior. It's a slight improved concept from the ElectricalGrid class which instead of creating an instance for every interconnected section of pipes it is just one static class which holds a vector of sections and manage all the stuff from there.


It's a bit more complex to code and setup but once that it's done is easier to maintain and to work with since the major work is done by the class itself without asking too much information to the Level controller class (Which is the one that holds all the information about every object instantiated in the current level).
I still need to code that sections will be separated with pump pipes and filter pipes to further enhance the visual effect of it, will be done this weekend.


Each section will be shown with a different color in the LiquidView Mode, this way it will be easier for the player to see what is connected with what and hopefully it should help him to avoid the liquid Waste problem.



Liquid waste and FilterPipe
Speaking of Liquid Waste: it is now officially in the game. To quickly recap what it is (I wrote about it in the previous update): it is a special liquid type that will be useless to the player and it will be generated when two different liquids meet inside a single pipe. This will force the player to carefully think about his pipes design.


To help the player in this job, the Filter Pipe object made its appearance. This will be a special pipe object that will be a useful tool in the complex task of designing the pipe system.
This object can be connected in all its four sides like normal pipes, but it can also be configured choosing what can accept as an input and what as an output. This configuration process can be done through an handy little window and each side can be configured with up to 3 different inputs and 3 different outputs.


Another little cool thing is that now the actual liquid is visible inside of the pipes in Liquid View mode, this will also help the player to visualize what and how much liquid is inside a certain pipe.



GUI Windows improvements
You can see in the previous gif that a part of this week was spent to improve a little bit the GUI interface. Small tweaks aside, a big change is that now windows can have title bars on top of them which can be configured, customized, and even dragged around!
Now you can rearrange windows just like you do in your favorite OS!   



Keep in touch
If you are curious to see how things will go feel free click any of these links to join our community:
Discord Server: https://discord.gg/mSCn4BU
YouTube channel for Timelapses: https://www.youtube.com/channel/UC2l3kcw6wUn4Z1-cr5UMLMw
Twitter: https://twitter.com/ElkiwyDev
Changelog: https://docs.google.com/spreadsheets/d/1kVIHUpf0jC8NFg5rxJF_hiWDkw-0VWnMI-Au4op0MiQ/edit?usp=sharing
Logged

Follow me and Project_BuildTutto by clicking any of these links: Discord Server: https://discord.gg/mSCn4BUYouTube channel for Timelapses: https://www.youtube.com/channel/UC2l3kcw6wUn4Z1-cr5UMLMw
ElkiwyDev
Level 0
***


View Profile
« Reply #12 on: February 09, 2018, 06:18:46 AM »

Hello everyone!
Stefano here, and welcome to the 13th Project_BuildTutto's Update!
I'm excited from this one because this week the project hit the 100 development days mark!
Looking back to the beginning of this adventure I'm now super happy to see how the things turn out, the development is going much smoother than what I could expect!
Enough talking now, let's dive in to the changed with the usual Timelapses, changelog, and weekly stats update:






Automated orders menu
A new menu made its appearance this week in the game: The automated orders menu. To quickly refresh your minds, previously if you needed a raw resource item you had to open the "BuyResources" menu, select which resource to buy, input the ammount you needed, and buy it. Now you can still do that if you want, but you can also set thresholds to automatically buy resources when the amount available in the level is below the threshold of that resource.


This menu is designed to be complementary to the BuyResource one because during the play through the player will need both of these: the BuyResource one will be useful when he will design new objects to try out different material properties and stuff like that; while the AutomatedOrders one will be useful to him in a slight more advanced state of the factory to constantly keep a stock of the most useful materials in order to avoid production chain slowdowns.



Trucks (aka "Camion" in the changelog) improvements
Each resource bought with one of the previously mentioned menus will arrive with Trucks, and they have been slightly improved this week to polish them up a bit. The functionality is still the same but now they are able to wait in line their turn without overlapping.


That aside, they received a code improvement too with a brand new Camion base class and two derived class from that: Camion_Solid and Camion_Liquid. The base class now manages all the moving, stopping, waiting in a line, and departing since it’s a behavior in common between both the trucks that carry solid stuff and the trucks that carry liquids. While the two derived class will manage what to do when they are ready to unload their stuff into the level, which is obviously different between solid and liquid.



Day/Night cycle and Time flow
Time now flows! The game has a clock with second, minutes, hours, days, months, and even years! This is a simple feature that will influence a lot the behavior of the working guys since they will be affected by the light and the temperature of where they are.
Now the previously created light system shine (pun not intended) much more because it will play a major role during the night time in the game.




Temperature
With the time stuff done I was able to introduce the temperature feature too! I needed to code time first because the ambient temperature will be derived by the current time of the day (daytime is warmer, nights are colder) and the current month of the year.
Currently the temperature in the game will influence only a graphical effect that will turn the screen to cold colors when below certain temperature or to warm colors when above another threshold. Later on this will affect a lot of different stuff: from guys behavior to objects deterioration.
One of the goals of next weeks will be to add objects like heaters and coolers to control the temperature inside rooms, but also adding small heat outputs to objects like lamps, furnaces, and things like that.




Bonus (not so) fun debugging story
Last Friday, after writing and posting the weekly update, I worked on a bug. It has been terrible. I spent 4 full hours inside visual studio to hunt down that monstrosity.
The test case was: I load up a level with some pipes, I click on one pipe to create the little object's detail window, I click the destroy button inside the window to destroy the selected object, and everything was fine...But when I tried to click another pipe to select it, the game would crash.
The VisualStudio screen after the crash was pointing out that the newly created object's detail window had a corrupted bitmap scheduled to be drew on screen.
Long story short here it's what was going on:


I wasn't removing the pointer of the delete pipe object from a vector of Pipe's pointers, but I was deleting that object. So, the memory was freed and marked as available memory to store new objects. When I create the new window, the program could place the window and his button inside that just freed memory and the old pointer stored inside the vector remain valid, but pointing to an object different from what the vector thoughts. Then I call a simple variable assignment function to all the pipe's pointers effectively corrupting the memory where the window's button was stored, but still without crashing the game. Then when the window tried to draw his button it would try to draw a corrupted bitmap and crash the game.
Lesson learned 1: always make sure to remove pointers to deleted objects.
Lesson learned 2: start to use that f***ing smart pointers.

Keep in touch
If you are curious to see how things will go feel free click any of these links to join our community:
Discord Server: https://discord.gg/mSCn4BU
YouTube channel for Timelapses: https://www.youtube.com/channel/UC2l3kcw6wUn4Z1-cr5UMLMw
Twitter: https://twitter.com/ElkiwyDev
Changelog: https://docs.google.com/spreadsheets/d/1kVIHUpf0jC8NFg5rxJF_hiWDkw-0VWnMI-Au4op0MiQ/edit?usp=sharing
Logged

Follow me and Project_BuildTutto by clicking any of these links: Discord Server: https://discord.gg/mSCn4BUYouTube channel for Timelapses: https://www.youtube.com/channel/UC2l3kcw6wUn4Z1-cr5UMLMw
ElkiwyDev
Level 0
***


View Profile
« Reply #13 on: February 16, 2018, 02:42:19 AM »

Hello Everyone!
Stefano here with yet another update! These updates are flying by faster than ever, it almost looks like yesterday that I started doing this and now we are already on the 14th update!
Anyway, this was a bit of a mixed work week since I really need to reorganize my working schedule and give priority on the feature list to work more smoothly through the weeks. With that said this week was still a productive one and a lot of things has been improved so lets dive in into the update!

I merged day 104 and day 105 videos because on Monday I did not record anything interesting and worked a lot on the Windows partition of my mac were I don't have the recording program.






Main controller rework and level switching
Brief recap on the main design idea: in the final game the player will not always play in the same spot, but instead he will have to play the game in different location through the run. The main location will be the player’s main base and warehouse where he will be able to build his own factory and produce all the items he will need for both expanding this base and building other buildings somewhere else. Other than that the player will play in the various land spot that the game will give to the player with some quest like :"Here is a brand new land spot, I want you to build a factory that produces at least X things per day" and the main goal of the game will be to successfully build and optimize all these various factories that the player will build through the game.

So, since the game will be played on various location in a virtual map I need to have an easy way to switch between maps to give the player freedom on where to play and what to do. These maps have to be connected through each other since the player will need to build stuff in his main base and send those items in the various maps in order to build the buildings there.

Right now, the game was not really offering that possibility, so I had to move many things around and merging/creating new classes to work better on that.
  • In particular I had two main controller classes before: Game and Level class. The Level was the class I used for the serialization process and the Game class was a helper class which was not serialized and was storing information like the path finding grid, the indoor mapping system, and stuff like that.
  • Managing two classes sometimes is trickier than managing only one big class so I finally decided to merge those two classes into the Level class.
  • After that I noticed that the Level class was holding both persistent information (like player info, money, object’s library, material's properties, game time and ambient temperature, etc...) and local information about the current location that the player was in (like objects, resources, ghost objects, orders management, terrain, electrical grids, liquid pipes, etc...).
  • So, the obvious next big thing to do was splitting that Level class into a PersistentLevel class and a more local version of Level. This process resulted into these two classes where the first holds only the global information and will be instantiated only once during the game session, and the second class is instantiated every time a new map will be available to play.
  • The PersistentLevel will then store a vector of each Level and turn them active or inactive when switching between maps.


The player will be able to switch maps through a menu (the current one is very ugly, but it gets the job done, in the future i will update that creating a detailed map to give the player a sense of presence in the space in relation to the various maps).




GFXs
Phew, that first point had a lot of text inside. Lets get a bit more relaxed with some particles!


After that very technical work on the Level I wanted to take a break and code something more fun than that, so I began to make particles to spice up a little bit the game. I'm not really satisfied on how those looks right now, but it’s a good starting point to improve them and the code is very flexible to modification.


Right now, the particles are present on the guy's footsteps and on the generator when producing electricity.



Gui improvements
This week I also took some time to improve a little bit the gui of the game (I know that it's still ugly has hell, but it's a placeholder, I'll update the graphics of that in the future). I added a new bottom persistent gui where the player can access the Library menu and the Blueprint menu, and also added a small side bar on the right portion of the screen where the player can see what resources are currently available inside the current map to know better what's inside the chests or around the level. The next week I want to add a bit of functionality to it and make that when you click on a resource on the right-side bar the game will select and highlight all the resources of that type inside the maps to let you know where they are stored.




Keep in touch
If you are curious to see how things will go feel free click any of these links to join our community:
Discord Server: https://discord.gg/mSCn4BU
YouTube channel for Timelapses: https://www.youtube.com/channel/UC2l3kcw6wUn4Z1-cr5UMLMw
Twitter: https://twitter.com/ElkiwyDev
Changelog: https://docs.google.com/spreadsheets/d/1kVIHUpf0jC8NFg5rxJF_hiWDkw-0VWnMI-Au4op0MiQ/edit?usp=sharing
Logged

Follow me and Project_BuildTutto by clicking any of these links: Discord Server: https://discord.gg/mSCn4BUYouTube channel for Timelapses: https://www.youtube.com/channel/UC2l3kcw6wUn4Z1-cr5UMLMw
ElkiwyDev
Level 0
***


View Profile
« Reply #14 on: February 23, 2018, 06:59:18 AM »

Hello everyone!
Stefano here with another update!
This week fewer stuff went on the changelog and feature list, but that's only because I dedicated a lot of time to the design and the planning of new objectives to aim at during the development of the project.
Since these weeks I'll be away from my usual working place’s, I'll pause the timelapse’s recording until I'll be back in March.






Updated To-Do list
The development process of a big project for me usually comes up to a three phases loop :
1) Write up a bunch of objectives and features to code until I think I wrote down everything the games needs
2) Code one by one each thing in the list until I come short on the list and I get depressed because I feel lost and without objectives
3) Get back to write objective since now the project is bigger and better than the time I wrote down the previous list and now I have a better vision of the project and its main goals.

So this week I wrote down a lot of things to do and now I feel much better.

The previous development iteration was aiming at having a nice code base and structure to work with crafting, machines, objects, pipes, cables, and stuff like that.
With this iteration I can aim at wrapping all those features up and start working to have a gameplay structure with Level's interactions, timecontrol, areas management, multiple floors level, guys improvements, and an overall better interface and communication with the player.


Level loading with txt
One of the points of the list which I cared the most at the time being was the ability to choose the starting layout of a level with an external .txt file.
This system will help me a lot with testing/debugging but also will be useful to choose starting configuration of different levels inside the game with a easy to use interface.

One of the bigger challenges was to design how to layout the .txt to have a good balance between flexibility, clearness, and easy to use.
After some thoughts about it I came up with this idea:

The first section will store a list of object's UniqueIDs and will link each ID with an increasing power of two number


The second section will be a comma-separated grid of number, where each number represent the sum of the object's number that should be present in that tile


So in this example a tile with a value of 130 will mean that in that tile will be present a floor object (number 2) and a chest object (number 128).

That txt will be then parsed if passed as a parameter to a level constructor and will be understood by the game and will create the level as planned out in the txt.




Minor GUI changes
A smaller, but still important, feature that as been added to the game this week is the presence of the new GUI object "WindowObject_Dropdown". This object seems like a button but on click will create a dropdown list of other buttons.



Keep in touch
If you are curious to see how things will go feel free click any of these links to join our community:
Discord Server: https://discord.gg/mSCn4BU
YouTube channel for Timelapses: https://www.youtube.com/channel/UC2l3kcw6wUn4Z1-cr5UMLMw
Twitter: https://twitter.com/ElkiwyDev
Changelog: https://docs.google.com/spreadsheets/d/1kVIHUpf0jC8NFg5rxJF_hiWDkw-0VWnMI-Au4op0MiQ/edit?usp=sharing
Logged

Follow me and Project_BuildTutto by clicking any of these links: Discord Server: https://discord.gg/mSCn4BUYouTube channel for Timelapses: https://www.youtube.com/channel/UC2l3kcw6wUn4Z1-cr5UMLMw
ElkiwyDev
Level 0
***


View Profile
« Reply #15 on: March 02, 2018, 05:11:58 AM »

Hello everyone!
Stefano here with yet another update.
This was the last work/vacation week and from the next week I'll be back at my usual working place and I'll be back at my working schedule and to the timelapses.





Areas
This week was aimed particularly at the introduction of Areas into the game. Areas are a common features in this kind of management games because it gives to the player the possibility to tell the game how to organize some aspect of it like where to store items if the usual storage system (chest and alike) are full, where to deposit items to sell, where the working guys should go when they have nothing to do and want some rest, and so on.

This is indeed a very important piece of the game since designing areas will be a crucial thing to do through the game.


The player will be able to create areas through a WindowObject_Dropdown menu item in the top side of the gui, he will have to choose what area to place and then simply draw it on the map with a draw rectangle tool.


Right now there are three different area types in the game: Storing, Crafting, and Resting. Sadly this week I had time to code completely only the resting area, the other two only have the structure and placing but does not impact the game in any way at the moment.




Fullscreen and minor changes
On monday I was able to work on some minor thing that had to be fixed and some other small features.

-One of the most noticable is surely the fullscreen mode, and with that the fact that gui elements now scale correctly and does not mess up entirely when the game's window change its size.

-Library menu is now organized and offer support to items category to narrow down the list in sublists and ease out the process of finding the right item.

-Machines that require electricity and/or fuel to run now have a small warning sign (WIP sprite on that) when do not have the required things to operate.


-The game now will automatically highlight objects when the player hover them with the mouse drawing a rectangle around them and showing their name at the mouse location.



Keep in touch
If you are curious to see how things will go feel free click any of these links to join our community:
Discord Server: https://discord.gg/mSCn4BU
YouTube channel for Timelapses: https://www.youtube.com/channel/UC2l3kcw6wUn4Z1-cr5UMLMw
Twitter: https://twitter.com/ElkiwyDev
Changelog: https://docs.google.com/spreadsheets/d/1kVIHUpf0jC8NFg5rxJF_hiWDkw-0VWnMI-Au4op0MiQ/edit?usp=sharing
Logged

Follow me and Project_BuildTutto by clicking any of these links: Discord Server: https://discord.gg/mSCn4BUYouTube channel for Timelapses: https://www.youtube.com/channel/UC2l3kcw6wUn4Z1-cr5UMLMw
ElkiwyDev
Level 0
***


View Profile
« Reply #16 on: March 09, 2018, 02:20:50 AM »

Hello everyone!
Stefano here with the 17th update of Project_BuildTutto!
I'm finally back at my usually working place, but still no timelapses because I wanted to get back at some boring work here and there on my windows machine and I didn't record that because I think is quite boring to watch a timelapses of someone who do nothing for 4 hours trying to solve bugs. Luckily the week wasn't just a solving bug week, but I did coded something interesting the last days so lets dive into the update!


(nb: line, word, and char count is a bit messed up because I din't worked on the pc that counts line until today)



Storage areas
This was a thing that I promised last week since I coded the general areas but not their specific behavior inside the game. The storage area is conceptually quite simple: the player designates an area where guys can store there items. Even if the concept was simple, I still had to think about it a bit to try find a way to code that in such a way that will work seamless with the storing code already in the game, and at the end I came up with the idea of creating fake item chests in each area’s tile. In this way the game sees the area like many simple basic chests and the code works just fine.


Later on the development I want to add a contextual menu to storage areas where players can choose which items can be stored inside the area and which cannot, to give them a way to better organize their working places and optimize the storing system to their needs.



Improved storage items and guy's storing behavior
Since I needed to make StorageAreaTiles basically a simpler chest item I finally changed and layered the chest class splitting it in GO_GENERIC_Storage (derived from Gameobject class) and GO_Chest(derived from GO_GENERIC_Storage class). This let me code all the generic behavior and function of a storage unit (like addItem, getItem, getFreeSpace, etc.) inside the generic storage, leaving the properties of each chest in the specific derived classes like GO_Chest(which can hold infinite different object types and has a maximum capacity of 1000 items) and GO_StorageAreaTile(which can hold only one object type at the time and has 100 max capacity).

With this layered system, coding a new storage unit is very quick and simple since I basically have to code a basic object and only change his properties.


Other than that, I also improved how the logic of storing things works making guys a little bit smarter. Now a guy will always try to see if there is already a not completed stack of the same item that has to store to optimize space and store items in a nicer and compact way.




Crafting areas and auto craft orders
Before talking about crafting areas, I need to introduce you the concept of autoCraftOrders: those are a type of order that the player can give to the game telling what items he wants to be automatically produced to be sold and obtain money. Those can be a continuous (infinite) order or can be limited to a specific amount, but to be completed the player will have to create a crafting area to tell the game where to craft and store those objects before loading them inside a truck and sell them.


So, crafting areas are similar to storage areas with the difference that those will not be an accessible storage unit but will be a unit that will store only items crafted there instead.


Right now, the background structure of it is already done but I'm still working on the autoCraftOrders menu to give an accessible interface to create orders.



Huge performance boost on Windows and bitmaps reloading
Monday and Tuesday were very bad days since I didn’t code that much and I spent a lot of time working on bugs and such, but at the end it all came up with an happy ending: a huge performance boost at no compromise at all!
Trying the game with visual studio CPU profiling I discovered something strange, my workload distribution of the main gameloop was something like this:

      -al_backup_dirty_bitmap() --- 80%
      -Draw() ---------------------------  7%
      -Update() ------------------------  4%
      -Other ---------------------------- ...

So, after some researching and googling I discovered that allegro backs up all the bitmaps to video memory EACH FRAME to avoid a problem that happens when the window get resized or toggles fullscreen where it loses all the bitmaps.
To work around that problem allegro suggested to implement a custom bitmap reloading system, and it was what I did. This system will reload all the bitmaps from disk when something happens to the window (resize or fullscreen) and will do nothing at all in normal playing conditions. Few hours of coding later I was finally able to disable that allegro feature and all the framerate issues in Windows just disappeared!



Keep in touch
If you are curious to see how things will go feel free click any of these links to join our community:
Discord Server: https://discord.gg/mSCn4BU
YouTube channel for Timelapses: https://www.youtube.com/channel/UC2l3kcw6wUn4Z1-cr5UMLMw
Twitter: https://twitter.com/ElkiwyDev
Changelog: https://docs.google.com/spreadsheets/d/1kVIHUpf0jC8NFg5rxJF_hiWDkw-0VWnMI-Au4op0MiQ/edit?usp=sharing
Logged

Follow me and Project_BuildTutto by clicking any of these links: Discord Server: https://discord.gg/mSCn4BUYouTube channel for Timelapses: https://www.youtube.com/channel/UC2l3kcw6wUn4Z1-cr5UMLMw
ElkiwyDev
Level 0
***


View Profile
« Reply #17 on: March 16, 2018, 01:46:17 AM »

Hello Everyone!
Stefano and some remaining flu here. This week has seen some ups and downs. On Tuesday and Wednesday I had flu that made a little bit trickier to work properly, but luckily it turned out productive enough to make an update here.
Good News: Timelapses are finally back! I recorded Monday, Tuesday morning, and Thursday.
PS: This weekend I want to revisit the timelapses making script and improve it to add background music and maybe some small caption here and there to make the final result more enjoyable to watch.






Completed AutoCraftOrders and added their menu window
   I did a lot of small thing and fixes this week; the only big chunk of code was the autocraftorders menu and final touches to them. With this menu the player can communicate to the game and order the objects that he want to be crafted by the guys and what to do with these objects.
   The menu starts empty with a "+" button to add a new entry to it.

   

   After pressing the "+" button the player can change every aspect of the template order given to him:
      1)The object type to craft
      2)The amount to craft
      3)If the object will be sold or stored
      4)If the order is currently active or suspended

   

   He can add all the orders he want as long as there are enough crafting area tiles available.

   

   



Minor changes and a lot of small fixes
   Doing some testing I tried to fix all the crashes and problems that were there and I managed to clean up a lot here and there.
      -BoxSelection of objects now does not get activated after the placement of areas
      -Areas can now be removed by a AREA_REMOVE tool
      -Improved and corrected some aspect of the storage algorithm
      -Blueprint menu now is displayed correctly in fullscreen
      -ScrollableLists now do not get cut off at the end in some menus
      -Fixed some bugs with the light renderer not being revisited after adding fullscreen
      -Improved a lot the lights creation.
      -Improved game loading on booting up calling non-trivial function only after all the objects are placed instead of once every object creation
      -Added camera locking to always being focused on visible objects without letting the player to move it away from the game map
      -Reworked wall sprites to remove the ugly terrain gaps between floors and walls (they are still a bit too large for my taste but I’ll think something about it)
      -Base font changed from Arial to DejaVu Sans


   
Keep in touch
If you are curious to see how things will go feel free click any of these links to join our community:
Discord Server: https://discord.gg/mSCn4BU
YouTube channel for Timelapses: https://www.youtube.com/channel/UC2l3kcw6wUn4Z1-cr5UMLMw
Twitter: https://twitter.com/ElkiwyDev
Changelog: https://docs.google.com/spreadsheets/d/1kVIHUpf0jC8NFg5rxJF_hiWDkw-0VWnMI-Au4op0MiQ/edit?usp=sharing
Logged

Follow me and Project_BuildTutto by clicking any of these links: Discord Server: https://discord.gg/mSCn4BUYouTube channel for Timelapses: https://www.youtube.com/channel/UC2l3kcw6wUn4Z1-cr5UMLMw
ElkiwyDev
Level 0
***


View Profile
« Reply #18 on: March 23, 2018, 01:26:55 AM »

Hello Everyone!
Stefano here with the 19th Project_BuildTutto Update! This has been a good week of polishing and old code tweaking to improve the general feel of the game and I'm really happy for the results!
Devlog timelapses has been finally upgraded with music and small captions to better tell to the viewers what they are watching, and I'm very happy with this result too!












Smooth Guy's movements
The first thing that can be noticed when playing now, is that the guys now feel way smoother than ever before. That's because before this update the guy's sprite was drew on the exact X and Y coordinate of the guy object, and since he is moving linearly in a grid, it felt a lot stiff and rigid.
Now I added a small little piece of code to keep the precise grid coordinates to manage all the logical stuff and use a new set of coordinates to draw the sprite. This new set of coordinates are calculated by a simple constrain that gives the player a feel of acceleration, deceleration, and smooth angles when turning.

   

   

   
It's a little hard to grasp the change from a compressed low framerate gif but I have to keep the gif size low for these articles Sad



Windows's animations
Changes are noticeable when opening and closing a menu too since they now have new little scaleAndFadeIn and scaleAndFadeOut animations. Those are still pretty simple and I'd like to improve them in the future, but give me a nice starting point to work with.

   
   


Item selling workflow completed
Last week I shown how the player can set automated crafting orders to craft a certain amount of item and mark them as a stack of items to be sold, but without actually selling it because the functionality was not implemented yet. Now that code is here and the player can effectively earn money by selling items!
This is another step into the direction of having the core gameplay up and running, so I'm very happy with this milestone.

   


   
Improvement to storing algorithm
I think that is now 3 weeks in a row that I keep improving this piece of code. When someone plays a game like this, even if he is a developer, he doesn't often think how many variables the developer has to keep in mind when planning something as "simple" as a storing management algorithm. It's really a mess, but now I think that I'm in a good position with it and it *may* be done for the time being.


Right now, the system can cycle between all the resource object not stored inside of something and recognize if they need to be stored or not. If They need to be stored it will look for a storage item not full and that can take that item type, but the system will prioritize nearest chests that already have that item type inside them to merge those two stacks, and it will also prioritize chests that will result full after inserting that stack of items to further optimize the space occupied by the storage. The “GetAStorageForThisItem” function can then return one or more chests, in this second case the guy will have to grab all the stack of item and split it into multiple chests in order to satisfy all the priority conditions.



Keep in touch
If you are curious to see how things will go feel free click any of these links to join our community:
Discord Server: https://discord.gg/mSCn4BU
YouTube channel for Timelapses: https://www.youtube.com/channel/UC2l3kcw6wUn4Z1-cr5UMLMw
Twitter: https://twitter.com/ElkiwyDev
Changelog: https://docs.google.com/spreadsheets/d/1kVIHUpf0jC8NFg5rxJF_hiWDkw-0VWnMI-Au4op0MiQ/edit?usp=sharing
Logged

Follow me and Project_BuildTutto by clicking any of these links: Discord Server: https://discord.gg/mSCn4BUYouTube channel for Timelapses: https://www.youtube.com/channel/UC2l3kcw6wUn4Z1-cr5UMLMw
ElkiwyDev
Level 0
***


View Profile
« Reply #19 on: March 30, 2018, 04:20:03 AM »

Hello Everyone!
Stefano here with the 20th Project_BuildTutto Update!
Man, these weeks are passing by so fast that it's incredible.












Alloys and AlloyMachine
Alloys were the classical things that were sitting in my todo list for so long that I almost forgot them because I was always thinking "Oh that thing will take so long to do it and will mess with so many other things in the game that will take me forever to do it" so I was always procrastinating over it. This week I somehow found the force to attack that todo-list point and, to my surprise, I was wrong about it because it did not messed up too much with the other part of the code and it was also pretty quick to do it!
Alloys are a rawresource-like item in the game that will have the same exact purpose off raw resource but can't be bought with in-game money. They are usually made inside a machine called AlloyMachine (Temporary name I think) and it take two specific raw material object (usually metal-like).

(Raw_tin sprite is still missing)

Two raw resource to make one item which is basically a raw resource? What's the point, you may ask. Well, an alloy has different properties from the two base one used to make it! For example, you can melt together tin and copper inside the alloymachine to make bronze, which has different base properties from copper and tin alone. Since the whole game revolve around the use of the correct materials for each object to have an optimal performance and output, this alloy mechanics can play a major role inside the game.



Guy's improvements
The work on the alloys took me only two days, so, on the other two days, I worked on the other todo-list point: Upgrading the codebase of Guys and their graphics.
The first needed step was to split the previous single class "Guy" into two classes "GENERIC_Guy" and "Guy_worker". This let me split the general functions and behavior of a normal guy (Like pathfinding, movement, sprite rendering) and leave the specific functions of a worker (Like order processing, building, grabbing, etc). This will help me a lot in the future when I will add other guys which will not be worker.
The second part of this point was to add stats to each guy in order to diversify and characterize them.


The stats let me add visual changed to them too. Now each guy can have a sprite made of:
   -1 of 4 head shapes
   -1 of 4 hair types
   -1 of 4 hair colors
   -1 of 4 body shapes (based on their strength and weight)
   -1 of 4 skin colors
   -body vertical scale based on their height stat



This properties lead to a pretty high number of different combination, but I'm still not 100% satisfied with this since I have still some work to do.



Small lights improvements
A small change that can benefit the game visual a lot is that I improved the light rendering over doors.
The light (or better the "darkness") of a closed room was previously rendered by full tiles, this was not working nicely with doors since those are not full tiles. To fix this I had to fiddle a bit with the raycasting behavior and change it when the ray was hitting a door object.
Another thing to solve was that when a door is open it should let the light pass through. This is still a work in progress point since I have to keep in mind a lot of different situation and I have to experiment a bit with this one.





Keep in touch
If you are curious to see how things will go feel free click any of these links to join our community:
Discord Server: https://discord.gg/mSCn4BU
YouTube channel for Timelapses: https://www.youtube.com/channel/UC2l3kcw6wUn4Z1-cr5UMLMw
Twitter: https://twitter.com/ElkiwyDev
Changelog: https://docs.google.com/spreadsheets/d/1kVIHUpf0jC8NFg5rxJF_hiWDkw-0VWnMI-Au4op0MiQ/edit?usp=sharing
Logged

Follow me and Project_BuildTutto by clicking any of these links: Discord Server: https://discord.gg/mSCn4BUYouTube channel for Timelapses: https://www.youtube.com/channel/UC2l3kcw6wUn4Z1-cr5UMLMw
Pages: [1] 2
Print
Jump to:  

Theme orange-lt created by panic