Errors Galore Devlog #2 5/12/2024


Hello again everyone! 

This is the second Devlog for Project Lance! (insert cheering noises)

In this short week of 5 days, I learned a lot and accomplished a lot. While I didn't achieve my goal of a full ecs conversion I did make some major headway into it.  Let's go over what I accomplished:

First, I got the basis of all the ECS components I need for this mode I am working on. This includes health combat, pathfinding, collision and rendering components. I also added an entity counter/ id system that will be used to quickly identify each character. (This was inspired by when I cheated in CK2/3 and dug into the JSON to see each character has an ID. I later found out that it's a very common thing to do. Thanks Paradox!) Below is a small snippet of my components for each unit. So far its only in one file but I plan to chop it up once I get ecs to fully work.


components example

Then, I created a npcgenerator. This as the name states, creates npc's! They are very simple in the since that they only have the purpose of fighting the other team. The code puts them into a dictionary styled format and then exports them into a JSON. Right now I do batch generations per regiment so each regiment JSON has all the npcs in them. In the future or for other game modes that will change. In the fighting one, since it is all that they will do, it makes sense to me to have it organized this way. These will be saved in the Data folder along with a lot of my other JSON's for now.

data folder

(all placeholder names)

After that, I commented out all my OOP code because I am proud of it. I also think I might need it in the future but for now it stays haha. I created a simple weighted system. In each of my factions there are unique ai commanders. these have a weight attached to them for each unit in the game. That weight is how well they favor them. which in the future will be able to changed based off of W/L rations each ai has in this mode. I think it would be a nice little way to do some simple ai training based off of what works best for their base personality.

Finally, The biggest thing I did this week was.......



Stare at things that look like this.....



 and this......

full project search

Working with JSON in CPP is a bit more rough than in python.

I found that out the hard way. I ran into error after error because I didn't have the foresight at the time to add fail safeties.
When an error like that hit, it was hard for me to really found out what was wrong. So I went back into most of my code and added snippets like this in it:



So instead of errors like above, I can see in my command prompt what's going on. Easier and a lot faster to debug.


(example of command line debug strings)

Who would have thought that preplanning will save you a lot of time huh?

Now, what is next?

I have almost all the systems in place for a simplified version of this to go down but I just have a few tweaks. I debated with myself on whether I should push this back to Wednesday or Tuesday but ultimately I did say every Monday. 

First priority:
simple working skirmish mode where factions fight it out to the end with working game modes.

second priority:
restructure ECS and components to be more modular and add more unit variation

third priority:
Faction strategies and commands.

Expect more fleshed out writing on skirmish mode next week~

Thank you for taking time to read my devlog. 
Happy Monday!


P.S. if you have any names for factions or groups you want to see, drop 'em in the comments. As long as they aren't copy righted or a rip off from another brand I'm happy to consider them.

Comments

Log in with itch.io to leave a comment.

My only ask is a goblin faction, it would cure my 9-5itis on the spot.

for sure!