bvschaik / julius

An open source re-implementation of Caesar III
GNU Affero General Public License v3.0
2.81k stars 315 forks source link

Support other games of City Building series? #108

Closed mirh closed 5 years ago

mirh commented 5 years ago

I really guess like Caesar IV is out of the league, but all the others (in particular Pharaoh and Zeus) should be doable.

crudelios commented 5 years ago

Give it a few years and... perhaps. While similar, the game engines have many structural differences that makes this request a non-trivial task.

bvschaik commented 5 years ago

They should be just as doable as Caesar 3 was, which means spending a couple of years figuring out how the game works exactly, and then another couple of years replicating the functionality, and then another year squashing all bugs introduced. I'm not able or willing to put that much effort into it again.

mirh commented 5 years ago

I really was not foreseeing that getting to support another similar game, required N time, with no previous knowledge re-use.

dalerank commented 5 years ago

You can do same work as sierra programmers when ported caesar to pharaoh, I think those games are very closed each to each @bvschaik what are you mind?

bvschaik commented 5 years ago

@mirh, @dalerank: The time is a little less than for C3 because some parts of the game, such as drawing the map and dialogs, are the same, and the basic engine structure is also mostly the same.

What's entirely different is the behaviour of the walkers, and that's about 1/3th of the entire codebase. Add in the monument building and more world map events that were introduced in Pharaoh, and the adventure structure and much more in Zeus, and you're looking at over half of the game that's new and has to be figured out. On top of that, Zeus (and maybe also Pharaoh, I didn't look at it yet) was partly written in C++, while C3 was 100% in C. That makes figuring out things way more complex.

crudelios commented 5 years ago

Apart from roadblocks, what other walker changes are there between C3 and Pharaoh?

Anyway this is akin to emulation. It would be possible to adapt what we have and make a game that behaves more or less like Pharaoh or Zeus, but getting the edge cases like julius does for C3 would take a long and deep understanding of the original games' source code. And C++, with its underlying function tables and whatnot, only makes everything more opaque.

dalerank commented 5 years ago

C++ more complex to support, plainc more easy for learn codebase and improvements, imho... people think that c++ more powerfull then c, but it false-positive, mostly when start coding in c++ they code in C with classes, it like drive f1 car in town (offtopic)

bvschaik commented 5 years ago

@crudelios Every walker type has its own state machine of actions to take. Take for example the fishing boat: when it's created at the shipyard its state is "going to find a fishing wharf". If it finds one, it enters state "sailing to fishing wharf", when it arrives: "docked at wharf", and from then on it cycles between "sailing to fishing grounds", "fishing", "sailing back to wharf", "unloading at wharf". The states, what has to be done for each state, and any logic behind those states ("find the closest reachable fishing ground that does not already have too many fishing boats") is unique to each game. True, service walkers like priests and bathhouse girls behave approximately the same in all games, but those are the easy ones. Pharaoh has hunters, monument builders that have to fetch resources, ferries, warships, festivals ... (and probably more that I forgot) that affect walker behaviour.

On top of that, Zeus implemented a more complex roaming walker system: for example maintenance guys remember the path they've visited most recently and take routing decisions based on that.

crudelios commented 5 years ago

@bvschaik you're right of course. And if one came up with a more dynamic way of doing thing, the clone would behave differently that the game.

Still, the amount of hard-coded logic that exists in C3 (and consequently in julius) is staggering. Really shows the game's age.