Cytopia - A free, opensource city building game

Cytopia - A free, opensource city building game

Postby JimmySnails » 03 May 2018, 06:27

Hi there,

I've started working on an, yet unnamed, open source, SDL2 based isometric engine for a simcity 2000 clone game two weeks ago. The goal is to create a free SC2K like City building simulator, with own sprites, so there won't be any copyright hassle. Right now i'm using a few sc2k sprites, but i'll draw my own when the basic engine is done.

So far, i can draw a X by X tilemap, access the tiles iso coordinates, draw different layers, zoom and reposition the camera. I'm currently working on terrain editing, which is not yet fully done but can be seen on my youtube channel.


Here is a video of my engine:
https://youtu.be/SRURHPl1hJc

And the link to my github page:
https://github.com/JimmySnails/IsometricEngine

The code still needs a lot of refactoring and i have quite the todolist (like framelimiting, overhaul of the sprite class and stuff).

I'm looking for a few devs who want to join me!

Regards,
Chris
Last edited by JimmySnails on 16 Apr 2019, 14:09, edited 1 time in total.
JimmySnails
 
Posts: 20
Joined: 03 May 2018, 06:12

Re: OpenSource, SDL2 based SimCity 2000 Clone

Postby charlie » 04 May 2018, 12:36

Nice start. Looking forward to seeing your progress! I like that you are open source from the get-go. People write imperfect code and constantly refactor it. Everybody gets that. Some people create barriers that they never manage to hurdle before they make their projects open to the public.
Free Gamer - it's the dogz
Vexi - web UI platform
User avatar
charlie
Global Moderator
 
Posts: 2131
Joined: 02 Dec 2009, 11:56
Location: Manchester, UK

Re: OpenSource, SDL2 based SimCity 2000 Clone

Postby farrer » 04 May 2018, 12:52

Looks promising.

Maybe for the simulation - and to save you a lot of implementation time - you could use as base the micropolis code (micropolis is the Free/LIbre version of the original SimCity) [1], and then extend it to support the additions of sc2000 (if I do remember, water system, new kinds of power plants, city zones with variable density, terrain, connections with other cities, etc).


[1] https://github.com/SimHacker/micropolis
User avatar
farrer
 
Posts: 110
Joined: 24 Feb 2014, 21:00

Re: OpenSource, SDL2 based SimCity 2000 Clone

Postby c_xong » 04 May 2018, 14:22

There is another SC2K remake here: https://github.com/rage8885/OpenSC2K
How does yours compare to this project?
User avatar
c_xong
 
Posts: 234
Joined: 06 Sep 2013, 04:33

Re: OpenSource, SDL2 based SimCity 2000 Clone

Postby JimmySnails » 04 May 2018, 19:43

Thank you for your comments!

I'm almost done with the terrain editing code. After that i'll do some refactoring, add some minor stuff like FPS locking. The next features will be "reading sprites (filenames) from a text file and map them to tile IDs" and afterwards reading / writing map files with height.
There's still a long way ahead until i'll get to actual game mechanics, but thanks for the link!

I'm a huge fan of the opensource scene, and after looking at other peoples code of isometric, tilebased engines i really thought i'd should go open source from the beginning. A lot of the stuff that's already done gave me quite a headache to figure out and i have reworked that stuff. I hope this will be useful for other other people too!

My game won't be a remake of SC2K but rather a clone. Right now i'm using the SC2K tiles as placeholder. I thought about adding an asset extractor tool late, when the games done... but i think it's way cooler to come up with own sprites (with the same art-style which i really love!).
If my project really succeeds, i'd like to have an own forum for it, where creative people can (easily) make there own tilesets. maybe even plugins? who knows.

I've already seen the opensc2k project, but it's based on JavaScript, while mine is based on C++. Besides that, their project focuses solely on SC2k (from savegames over to the assets) and right now they can only draw a SC2K city.
My project starts from scratch, focusing on the engine. When the engine is done (drawin, terrain editing, gui, ...) i can start implementing game mechanics. So there's more freedom to implement own stuff and ideas :)

I really love SC2K and played it a lot since i was a child, but it always lacked so many great features, like underground power lines, (a lot of) more buildings, different buildings for different centuries and stuff.

I'll post an update, when i'm done with the terrain editing feature!
JimmySnails
 
Posts: 20
Joined: 03 May 2018, 06:12

Re: OpenSource, SDL2 based SimCity 2000 Clone

Postby JimmySnails » 06 May 2018, 18:24

I'm done with the "raise terrain" feature. It works the same as in SC2K :)

Implementation: I have an enum which represents the position of the elevated neighbor tile. In an std::map, the possible neighbor combinations are mapped to tile IDs. Then i'll recurse each neighbor of each tile that needs to be elevated and set the correct tile id (sprite). So the map-cells are kinda "self-aware" of their surroundings.

Right now it supports only one height level.
Next i'll implement a "read from file" function to map Tile IDs to file names and afterwards i'll refactor my Sprite code. Then i'll tend to terrain editing code again.

See for yourself:
https://youtu.be/tjfcg3IRlE0

Or download and compile the code :)
https://github.com/JimmySnails/IsometricEngine/

If you're interested in my project, feel free to drop me a message. Still looking for contributors ;)
JimmySnails
 
Posts: 20
Joined: 03 May 2018, 06:12

Re: OpenSource, SDL2 based SimCity 2000 Clone

Postby flavio » 08 May 2018, 17:32

Hi! It is a cool beginning, please keep up the good work!
flavio
 
Posts: 61
Joined: 21 Mar 2014, 11:06
Location: Rome

Re: OpenSource, SDL2 based SimCity 2000 Clone

Postby JimmySnails » 21 May 2018, 08:40

A lot of time has passed and it's time for my first official release! V0.1 Tech Preview!

https://youtu.be/wuPgGq2RQ_8

So far, i have done more than i have i have initially planned and some features turned out to be more work than originally anticipated :-)
I've set up travis ci (with a doxygen build deployed to gh pages)

Under the hood, i rewrote a lot of my code. Map Cells are now stored in a vector matrix. When a cell (tile) is elevated, it checks each surrounding tile and changes it's texture accordingly or elevates itself if if there's more then one height level difference.
With height levels taken into account, my plain screen to iso coordinates algorithm wasn't working anymore, so for every click each cell in the vectorMatrix is checked for pixel collision (with the mousecursor position) and for it's z-level, and the correct isoCoordinates are retrieved.

Tile ID - Filename mapping is done via a json file.
Settings are now read from a json file.


I've also started to document my code here:
https://jimmysnails.github.io/Isometric ... index.html


Next steps:
I'm not perfectly happy with the performance of the vectormatrix class and the overall RAM usage, i'll refactor that
It's time for a basic UI implementation!
Auto generate maps with height levels
Add water / rivers

Hope you like my project and are as eagerly excited as i am for the next release!

And as always, if you'd like to join my project, drop me a message! ;)
JimmySnails
 
Posts: 20
Joined: 03 May 2018, 06:12

Re: OpenSource, SDL2 based SimCity 2000 Clone

Postby Imerion » 22 May 2018, 23:14

Nice to hear you are making progress with this! Looks promising!
Try my games! : My Games - Read my FOSS Games Blog! : Free Game News
Imerion
 
Posts: 100
Joined: 09 Apr 2011, 19:37

Re: OpenSource, SDL2 based SimCity 2000 Clone

Postby SecureUvula » 24 May 2018, 19:36

Looking good. The readme on Github mentions both SDL 2 and SDL 1.2. I'm guessing you're using SDL2, then?

I'd like to make a Streets of SimCity clone someday, if your project ends up being compatible with the original SimCity 2000 files I might peek at your code to see how to load them. (Streets let you drive a car around SC2k cities)
https://activated-onion.itch.io/ "Not only does she do it for free, she doesn't do it at all."
User avatar
SecureUvula
 
Posts: 44
Joined: 22 May 2018, 03:26

Re: OpenSource, SDL2 based SimCity 2000 Clone

Postby JimmySnails » 25 May 2018, 06:49

The readme on Github mentions both SDL 2 and SDL 1.2. I'm guessing you're using SDL2, then?


ooh, i don't know how that got there. You're right, i'm using SDL2. I've corrected it, thanks!

Loading the original SC2K files will be a feature, but it'll take quite a while until i tackle that problem. I might write an extractor for the SC2K files, together with a json file to map the extracted files to internal tileIDs. that's not too hard and there are a lot of examples out there. If you're interested in that topic, you could join my discord and i could point you in the right direction, maybe write the extractor together?

I've reworked quite a lot of the code and cut startup time for 128x128 tiles (in Debug configuration, which is mich slower) from 5 seconds to ~500ms.
Right now i'm working on the user interface and i've come up with an interesting concept how to implement that.
JimmySnails
 
Posts: 20
Joined: 03 May 2018, 06:12

Re: OpenSource, SDL2 based SimCity 2000 Clone

Postby Wuzzy » 15 Jun 2018, 14:14

TBH, I didn't really like SimCity 2000, I liked SimCity 3000 much more, especially because there were many possible slopes. SC2K was too simplistic IMO, it lacks a bit of depth. Maybe I'm biased because SC3K was the first of the SimCity games I've ever played and I just didn't play SC2K very often. I think SC3K is still a great game, even with SC4 in mind.

The graphics of SC2K are also seriously outdated and low-res in my opinion, I would not clone that either, not even the style.

On the other hand, a SC3K clone would be probably too much work. If you manage to pull of a SC2K clone, but with updated, modern graphics and a proper look and feel and sounds, it might become a nice little game anyway.

Anyway, I wish you good luck with your project! :-)
User avatar
Wuzzy
 
Posts: 989
Joined: 28 May 2012, 23:13

Re: OpenSource, SDL2 based SimCity 2000 Clone

Postby SecureUvula » 15 Jun 2018, 17:08

I haven't played 3000, but SC4 looks much more complex than SC2k. In 2k, for instance, buildings can only be built on flat ground. Easy. In SC4 you have to judge how flat the ground is, and it flattens a bit (I think) when you build things, and the terraforming is so complicated.

I may be biased because driving around my SC2k cities shooting up other cars was fun.
https://activated-onion.itch.io/ "Not only does she do it for free, she doesn't do it at all."
User avatar
SecureUvula
 
Posts: 44
Joined: 22 May 2018, 03:26

Re: OpenSource, SDL2 based SimCity 2000 Clone

Postby JimmySnails » 20 Nov 2018, 21:14

It's been a long time and i've been quite busy.

Today i've release v0.0.2 tech demo preview:
https://github.com/JimmySnails/IsometricEngine/releases

A lot has happened since the last release. (277 commits to be exact)
- The project now has it's own theme song. A musician named sqwdmusic showed up and created one exclusively for the project.
- A dev named Marz showed up and helped with the CMake files.
- A graphics artist has joined the team and has provided a lot of custom textures for the game. So no more sc2k tiles and no copyright problems.

Technical stuff:
- I've created my own SDL2 based UI framework and it did came out quite nicely!
- Greatly improved the class design
- Roads !
- improved performance
- And much more

I'd be happy if you'd like to try out the new release. A youtube video will follow soon.

Btw, i'm still looking for another dev! So if anyone is interested, drop me a message.
JimmySnails
 
Posts: 20
Joined: 03 May 2018, 06:12

Re: OpenSource, SDL2 based SimCity 2000 Clone

Postby JimmySnails » 30 Dec 2018, 20:00

The project is coming along nicely. A lot of custom sprites are done. Here are a two screenshots.

unknown.png


053cbea2-b136-44b8-880a-d42a0d743e37.jpg
JimmySnails
 
Posts: 20
Joined: 03 May 2018, 06:12

Re: OpenSource, SDL2 based SimCity 2000 Clone

Postby drummyfish » 30 Dec 2018, 20:12

Looks awesome, nice when zoomed in as well as when zoomed out, which is how it always should be. I like to hear the project is doing well and that that the code is free from the start. From my experience projects that keep waiting grow bloated and then either never open up, or fail to get contributors because it's very hard to jump in at that stage.
User avatar
drummyfish
 
Posts: 448
Joined: 29 Jul 2018, 20:30
Location: Moravia

Re: OpenSource, SDL2 based SimCity 2000 Clone

Postby Hythlodaeus » 05 Feb 2019, 00:23

Sprites look nice design-wise, but they're mighty dark and depressing in terms of colour palette. One of the things I enjoyed a lot about SC2K was the vibrant colours that really made bigger cities pop. Would it be possible for the graphics for this project to follow a similar colour scheme?

Additionally, there are many sim city-like graphics packages you might find interesting in open game art, for example:
https://opengameart.org/users/pixel32
Hythlodaeus
 
Posts: 40
Joined: 26 Feb 2013, 14:04

Re: OpenSource, SDL2 based SimCity 2000 Clone

Postby JimmySnails » 15 Apr 2019, 08:45

Hello there,

Haven't posted here in quite a while.

The project was renamed to Cytopia. It is no longer intended to be a SC2K clone, but a game on it's very own.
We now have a team of 4 graphics artists, one awesome sound designer and a lot of people helping out the project in another ways.

Lots of new buildings have been made and are currently in the process of being added to the game for the v0.2 release.
There's now an option to save / load game and so on and the game is really beginning to take shape.

Visit our project page at
https://www.cytopia.net

Here's our latest release trailer:

youtu.be/o6MTJVp3a8E

if you want to try out Cytopia without building / installing it, we now have a (still WIP) emscripten port online at:
https://game.cytopia.net/

If you like, join us at
https://discord.cytopia.net
or follow our dev blogs on reddit:
https://reddit.cytopia.net

If you're interested in helping out, we're still looking for contributors!

Looking forward for your comments!
@yHthlodaeus
We are highly focussing on moddability, so you can either add or replace existing sprites with your own, if you don't like some buildings.
We don't use sprites from the internet, as we have a well seasoned Graphics Artist Team now :)

Maybe someone will even make an innofficial SC2K texture pack? Who knows :)
Last edited by JimmySnails on 16 Apr 2019, 06:39, edited 2 times in total.
JimmySnails
 
Posts: 20
Joined: 03 May 2018, 06:12

Re: OpenSource, SDL2 based SimCity 2000 Clone

Postby fluffrabbit » 15 Apr 2019, 16:36

Well, that blew up fast! Awesome!
fluffrabbit
 
Posts: 557
Joined: 11 Apr 2019, 11:17

Re: OpenSource, SDL2 based SimCity 2000 Clone

Postby JimmySnails » 16 Apr 2019, 06:38

Thx :) Yeah, i'm dedicating a lot of time for the project. With our great community this is very rewarding. Unfortunately i'm still the only developer... Hope this changes soon :)
JimmySnails
 
Posts: 20
Joined: 03 May 2018, 06:12

Re: OpenSource, SDL2 based SimCity 2000 Clone

Postby fluffrabbit » 16 Apr 2019, 10:50

JimmySnails {l Wrote}:Thx :) Yeah, i'm dedicating a lot of time for the project. With our great community this is very rewarding. Unfortunately i'm still the only developer... Hope this changes soon :)


I just had a glance at the project. Though I don't speak for everyone, I feel that having this branching source tree of dependencies is a common ailment on Github.

Cytopia_Resources would be like a cytopia-data package in terms of Linux distro packaging, so it (currently including music) and other large assets should be completely separate, not compiled with the Cytopia source code. You would then tell cytopia where to find cytopia-data, perhaps defaulting to an in-tree folder (like for a Windows installer) but also supporting a separate system folder.

As for Cytopia_ExternLibs, SDL and zlib are unmodified so ideally you should use the upstream sources and keep the number of dependencies to a minimum before it gets out of hand. On Linux you would use the libs installed globally by the system package manager, on Windows and Mac you might say to the person building "go get these things and put them here".

I'm not a particularly good programmer, these are just my observations, to be taken with a grain of salt. Developers might want to contribute a tiny bit more if the source tickles their fancy.
fluffrabbit
 
Posts: 557
Joined: 11 Apr 2019, 11:17

Re: OpenSource, SDL2 based SimCity 2000 Clone

Postby dulsi » 16 Apr 2019, 13:44

You edit the first post to have your new project name in the title of the thread. It looks nice. How much work was it to get emscripten port? I've thought about playing around with that.

For cloning I prefer everything in one repository over fluffrabbit's suggestion but it doesn't make a big difference either way. (Without Cythopia_ExternLibs because I don't worry about windows programmers but that is still a minor thing. Plume-creator-legacy, a novel writing tool, does the same thing for external libs which I then strip out to make an rpm.)
dulsi
 
Posts: 570
Joined: 18 Feb 2016, 15:24

Re: Cytopia - A free, opensource city building game

Postby JimmySnails » 16 Apr 2019, 14:20

Thx for your comments!

Cytopia_ExternLibs is just windows libraries and optional, so anyone interested in windows development can start without having to worry to download (i think it was 8?) SDL packages, settings PATH, and a lot of other things.
This way, it just works out of the box on windows. Also it saves build time on the appveyor build.

Cytopia_Resources is a first approach on keeping the main repo size small. I agree, that images should be moved there.

Cytopia supports many platforms and the resources are bundled. On MacOS they're part of the "App Image", so they can't really have a custom path and i want to keep that as simple as possible for the player.

Edit: You can easily clone it via
{l Code}: {l Select All Code}
git clone --recursive <URL>

or get the submodules via
{l Code}: {l Select All Code}
git submodule update --init --recursive


That's in the readme too :)

Regarding the emscripten port... Tbh, it was hell :D
I couldn't get it to work on linux (debian), almost after giving up, i tried it on windows, and it worked miraculously out of the box. A few adjustments to the source code, and suddenly it stopped working, because i couldn't compile zlib (and SDL_mixer) any longer... (seemingly due to this bug: https://github.com/emscripten-core/emsc ... ssues/8341)
i've postponed the emscripten port until the next release that should fix this issue.

I also haven't commited my changes yet to a branch because this needs some cleanup and i can't test it any longer... For the same reason i haven't yet announced it officially or added a link to our website
If you're interested, drop me a PN, mail (jimmysnails@cytopia.net) or visit our discord, maybe i can help you out.

I'm really glad we have the emscripten port online now, it's an easy way for people to test the game without installing / downloading anything.
JimmySnails
 
Posts: 20
Joined: 03 May 2018, 06:12

Re: Cytopia - A free, opensource city building game

Postby fluffrabbit » 17 Apr 2019, 00:38

You're doing a great job of managing the project. I just love to nitpick.

Submodules are a bad practice. Using all of SDL's periphery libs for a game is a bad practice.

As for Emscripten, Debian's version is a broken mess and its maintainer seems to be on hiatus so we're on our own when it comes to that. But yeah, there's nothing more immediate that trying it out in a web browser.
fluffrabbit
 
Posts: 557
Joined: 11 Apr 2019, 11:17

Re: Cytopia - A free, opensource city building game

Postby Lyberta » 17 Apr 2019, 14:45

Deleted.
Last edited by Lyberta on 01 Oct 2021, 06:57, edited 1 time in total.
Lyberta
 
Posts: 765
Joined: 19 Jun 2013, 10:45

Who is online

Users browsing this forum: No registered users and 1 guest

cron