Looking for a strategic 4x simulation framework

I’ve been looking for a framework for a 4x simulation game, like Master of Orion and similar. Preferably with Playmaker support. But I can’t find anything, let alone something that works with Playmaker.

So I’m looking for some suggestions for something that can help with strategy simulation aspects, like research trees, bases, politics etc. Or something that lets you create big databases with complex relations between different game mechanics in a manageable way.

I doubt you will find something that handles everything.

This will get you most of the way there:

https://assetstore.unity.com/packages/templates/systems/turn-based-strategy-framework-50282

But really you are better off following something like https://shadowplaycoding.com/portfolio/4x-space-game/ as far as it is completed, to get a better idea of how to build something like this.

You are unlikely to find something that can be used purely with playmaker for this.

2 Likes

I always say the same thing in threads like these. You are better off designing your own core domain from scratch. Its a big risk of asset flip feel otherwise

2 Likes

Wow that’s a good resource. Thanks!

While there might not be a single asset that helps support what you want, you can usually find multiple assets, like database management, that you can assemble together to make your game. It usually goes, first design your game, and then search for assets/systems that can help catapult you forward, and then integrate those.

EDIT:
Actually, I’d like to add that it’s best to write the core game all in code that is independent from Unity. Especially for a 4x/strategy game. I made the mistake of implementing a lot of my turn-based tactics game using MonoBehaviours, ScriptableObjects, etc. and when it came time to simulating AI, I regret it significantly. I spent a month or so refactoring my code such that I don’t need to rely on Unity (i.e. I don’t have to create GameObjects for AI unit simulation). Now I can instantiate AI units for simulation to generate multiple outcomes to help with scoring.

1 Like

You are most welcome :slight_smile:

I agree about trying to abstract from unity as much as possible, I think thats good practise not just for this but any game :slight_smile:

OP (And you if you are interested) there is also https://github.com/TheMaximum/MaximumCiv and probably more free on github. I expect this would be a good base to start with, but you can always get a few assets and sling them together too, for example you could use the turn based asset I linked and hook that into some sort of skill tree type asset to allow research trees, etc.

Good luck! :slight_smile:

1 Like

@MadeFromPolygons_1 Thanks for all the suggestions. Not exactly what I look for but you never know what sort of info can come in handy later on.
No I don’t want a complete project to start with, I too really hate the copy/paste feel some assets create. What I want is some kind of spreadsheet style overview of everything and something that can manage lots of systems that send data back and forth. Something that can visualize while also providing some sort of mechanics handling.
Playmaker comes a long way here, but their arrays are very hard to use effectively due to not having 2d arrays or the option to drag and drop and rearrange in the editor. Otherwise it’s great and during the years I used it I would never not use it for game mechanics. It makes it so easy to see errors and logic faults it’s insane.

@aer0ace Heh, you are way more advanced than I am. There is no way I could do anything outside of Unity, and I don’t want to. It’s not going to be Paradox level of complexity, just something decently simple fun thing. I hope.
But do you have a suggestion of such database asset?

I am not really following you, you say you dont want a complete template and then basically describe a complete template?

Playmaker is about as easy as it gets, I think you are going to have to bite the bullet and accept that some of your own systems will need to be authored for this sort of stuff.

I recommend looking into https://learn.unity.com/tutorial/editor-scripting because it sounds like what you want are some pretty specific tooling that is useful to you - likely you will need to author it then if its specialized.

That is if you are actually talking about what I think you are. But even with all that, I still dont get what you mean by “spreadsheet style overview of everything and something that can manage lots of systems that send data back and forth” - do you mean a database?

In which case, look into scriptable objects, or something like SQL etc

It sounds like you are lumping a bunch of stuff together - you probably want a database to store all the bits of data and push pull data from the game, you want some sort of project management / design software to manage all the design info (look up “notion”), and you probably want a few ready to go systems from asset store to help speed up development as you start (such as a skill tree system to use to make a research tree).

But the way you are describing it is very confusing to work out what you are actually looking for, so I am just guessing.

3 Likes

I think you misunderstand me on this one. While I decouple my game code from Unity, I’m still using Unity to present the game to the player. Imagine this: I create a chess piece GameObject in Unity. I use pathfinding to determine the valid moves for that chess piece. Then, when writing AI, I’d like my AI to determine all its possible best movesets. This means I have to create a GameObject for all the possible moves, because that’s how my chess piece works. That’s not cool, when I don’t need a GameObject for this. Just a bunch of floats, like position, and travel distance.

Don’t get the impression that this just applies to the Paradox guys. This is for designing your game such that a year or two from now, when your game gets too complex and grinds to a halt you won’t just give up. It’s difficult to understand this right now, but eventually you’ll get to a point where your game needs to be rearranged (it’s called “refactoring”), so that it can support more features and perform a lot better.

Also don’t get the impression that the game I’m making is anything like what Paradox is making. My game is hardly Advance Wars, and I’m 5 years deep in it. Good technical design practices will help you create richer game systems that won’t perform like sh*t.

I don’t. Again, this is highly dependent on your goals. I can only tell you what I’m planning. For a future 4x game I’ve been designing, I’ve identified that I may go with SQLite as the backing store. So far the design is offline, single player, but I plan on a lot of object storage, memory, places, etc. I guess, towards the Dwarf Fortress/Rimworld sort of level of complexity. Then again, I could be wrong. Perhaps there’s something more appropriate for what I’m doing. But that’s the part of game development that requires YOU to do your own research as to what’s best for your game.

2 Likes

I think you’re thinking too much of this. It just means I just want a simple overview of everything with easy editing, like a spreadsheet but for arrays. It doesn’t have to though, it was just an example. Like I said, I couldn’t find anything really helpful in the store.

Yes pretty much, except mechanics for the actual gameplay.

Sorry I usually know what I’m looking for, but when it comes to strategy games all I could find was grid movement and turnbased systems and that’s not something I’m looking for here. Just a way to visualize and manage data that makes sense in this situation.

@aer0ace Thanks for your thoughts. You are way more knowledgeable than me so I’m not sure how to apply this. But I can say I’m not going for Dwarf Fortress complexity.
You both mentioned SQL which I don’t know anything about and thought that was just for web stuff, so I should check that.

But what exactly do you imagine this looking like? I really cant understand how nothing sugested here matches what you need. That makes me think what you are wanting isnt really practical when thought through properly, otherwise it would exist. Did you actually look at notion? Its used by major companies and a ton of games for exactly what you describe, if it doesnt fit, then literally you are in custom tool territority because nobody else is thinking how you are (which is fine, you just need to identify that and adapt and make your own tooling).

Sorry, but if notion doesnt suit then please explain what you mean by spreadsheet for arrays? It just sounds like what you are looking for has nothing to do with 4X games and that maybe you should look into how to control the inspector a little before embarking on this project. I have never had an issue with how to view arrays, so this is really odd to me, let alone in a thread about 4x templates

I have exactly what you describe “arrays as a spreadsheet” in notion for all the stats, entities, locations etc in my game. We even have an asset library setup on it, wiki, task board, the works. So again, if this isnt what you mean please be specific instead of saying “you are overthinking X” etc because you are really not making this easy :slight_smile: I am overthinking, because you are not being specific and instead using wishy washy language and not saying what you need in clear terms - probably because as said you dont know what you need. In which case actually look up notion instead of assuming its not what you want - everything you have said says it is.

1 Like

4X games are generally pretty custom, each game with its own unique needs. I’ve assumed that is why you don’t see any ready made turn key solutions for them.

1 Like

You can start with SQLite.
But here is the first problem. As you mentioned 6ou know nothing about SQL, but focusing on spreadsheets. To design effectively game in such manner, you will need pretty solid knowledge about data bases and how to manage stuff.

However, if you all about spreedsheets, go look into Civ III, and maybe Civ IV. They were made modable using spreadsheets. You can pretty much redesign most of the game, to your liking.

It won’t be your game to sell, but you can run community for your mods. Start with that and you will soon understand, what it involves.

Otherwise, you won’t find full RTS game, where you just change some values and can call your own. Maybe you could buy someone’s work however. However, you can find all components you need. SQL, maps generators, UI with templates, AI, path finding, units and other objects, networking solutions, etc.

In general, don’t expect game dev to be 5 min work. It can take ages. Specially for games like RTS.

Edit:
btw, have you looked actually into asset store for RTS?
https://assetstore.unity.com/?q=rts&orderBy=1

2 Likes

Which is kind of ironic because they do have a lot of similarities. Endless Space, GalCiv, MOO, etc.

Thanks for the suggestions, I think I have enough to start. Don’t know why people thought I want a complete solution though? Just a solid base frame.

I found this though: SimpleSQL | Integration | Unity Asset Store
That looks like a good start and it has Playmaker support.

I’ve haven’t checked RTS much since it is not really what I look for, but it might have some stuff too.

Github search turned up this: Star Ruler 2 (4X / RTS) has its full source code posted by the developer under MIT License GitHub - BlindMindStudios/StarRuler2-Source: 4X Space Strategy game Star Ruler 2's open source distribution. (C / C++). Seems like an early Stellaris, so pseudo-realtime as opposed to explicitly turn based.

Wow. That’s a good find. Thanks for sharing.

How to open this in unity?

How to open what in unity? If you mean the starruler 2 c/c++ game - you cant. It was not made in unity.