Cytopia - A free, opensource city building game

Re: Cytopia - A free, opensource city building game

Postby fluffrabbit » 17 Apr 2019, 17:37

I use apt-get (or rather its apt wrapper) though that's probably not the ideal package manager. It works for me on Linux. On Windows and Mac, or in offline situations, building the source of dependencies with the game is a good way to go if the dependencies are reasonably small (as SDL is). As for all the other libraries that call themselves SDL, I think there's something to be said for keeping a game's codebase and dependencies light and lean.
fluffrabbit
 
Posts: 493
Joined: 11 Apr 2019, 11:17

Re: Cytopia - A free, opensource city building game

Postby JimmySnails » 18 Apr 2019, 06:37

My deb and rpm packages have dependencies that get installed automatically :)

The 3rd party libs are not in the deployment, except for windows. (and we all know on windows you have to deploy them...)
I'll also add SDL libraries to macOS deployment, since some mac users don't even know what a library is or how to install it... (they approached me and told me that the game is not working...)

Someone requested a flatpack package. I'll take a look into that for the next release.
JimmySnails
 
Posts: 19
Joined: 03 May 2018, 06:12

Re: Cytopia - A free, opensource city building game

Postby fluffrabbit » 18 Apr 2019, 07:39

If by deployment you mean binaries, then yeah, Mac users definitely need the libs. I feel like I've been drifting off-topic here but hey, code is something we all understand.
fluffrabbit
 
Posts: 493
Joined: 11 Apr 2019, 11:17

Re: Cytopia - A free, opensource city building game

Postby JimmySnails » 08 May 2019, 09:08

Good news regarding external libraries :)

We've got a new contributor who added conan, so Cytopia can be built anywhere now. It also fixed our MacOS build, which now has audio playback support. yay!
All libs are now statically linked, so this greatly helps with deployment.

For those who want to build the src without using conan, we've added a "USE_CONAN" cmake option.

The next release (v0.2) is still quite a while down the road, as we're working hard on awesome new features, optimizing the code and so on, but here are a few spoilers:

I've finally added layers, so everything looks really smooth now :)
Image

Also, another contributor showed up and he's working on procedural terrian generation.
Image


If you like, join us on discord:
https://discord.cytopia.net
JimmySnails
 
Posts: 19
Joined: 03 May 2018, 06:12

Re: Cytopia - A free, opensource city building game

Postby fluffrabbit » 08 May 2019, 09:26

Nice! The only submodule now is Cytopia_Resources (still just music in there but whatever). I would very much like to build without Conan. Could you update the build instructions to mention the USE_CONAN flag?

A few unrelated suggestions based on what I saw in the readme:

A Qt based tile editor for editing TileData JSON files.

Not good. Qt gets updated more frequently than game APIs and is a large dependency that has been known to cause compatibility problems. If you want native widgets, use wxWidgets. Really though, the editor should just be part of the game and rendered with SDL or the graphics API.

Scripting language for mods (like LUA)

Lua is not a desirable scripting language for a number of reasons. I would suggest alternatives: the V8 JavaScript engine, libtcc for C scripting, or pure JSON.
fluffrabbit
 
Posts: 493
Joined: 11 Apr 2019, 11:17

Re: Cytopia - A free, opensource city building game

Postby JimmySnails » 08 May 2019, 10:55

Nice! The only submodule now is Cytopia_Resources (still just music in there but whatever). I would very much like to build without Conan. Could you update the build instructions to mention the USE_CONAN flag?


Actually there is a link in the sidebar :)

https://github.com/JimmySnails/Cytopia/wiki/Build-instructions-without-Conan

If you set the flag -DUSE_CONAN=OFF (or in ccmake / cmake-gui) the old behaviour is used :)

A Qt based tile editor for editing TileData JSON files.

Not good. Qt gets updated more frequently than game APIs and is a large dependency that has been known to cause compatibility problems. If you want native widgets, use wxWidgets. Really though, the editor should just be part of the game and rendered with SDL or the graphics API.


That is actually just the tool for managing the json data, so you don't have to do that by hand. It's only used for adding new sprites and stuff, so if you don't want to do that, don't build it, it's an optional target :)

Lua is not a desirable scripting language for a number of reasons. I would suggest alternatives: the V8 JavaScript engine, libtcc for C scripting, or pure JSON.

I've also considered AngelScript. And i'm open for anything, but unless a nice contributor comes around, this is a feature for later. I'd say, that anyone who takes the task can decide the scripting language ^^
JimmySnails
 
Posts: 19
Joined: 03 May 2018, 06:12

Re: Cytopia - A free, opensource city building game

Postby fluffrabbit » 08 May 2019, 11:53

That flag is not in the document. Also, the wiki is nice but if somebody nukes GitHub it would be nice to have build instructions in the repo.

One thing about the build that's kinda weird is how you already have a directory called "build" with some stuff in it, which is the standard name for a folder in which a cmake build is performed, so I tried to build in a folder called "new_build" instead using the following lines:

{l Code}: {l Select All Code}
mkdir new_build
cd new_build
cmake -DUSE_CONAN=OFF -DCMAKE_BUILD_TYPE=Release ..


That's as far as I got, and here is the terminal output:

{l Code}: {l Select All Code}
-- The CXX compiler identification is GNU 7.3.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Conan: checking conan executable in path
-- Conan: Found program CONAN_CMD-NOTFOUND
-- Conan: Version found
-- Conan: Adding AFG remote repositoy (https://api.bintray.com/conan/anotherfoxguy/conan-packages)
-- Conan: Adding bincrafters remote repositoy (https://api.bintray.com/conan/bincrafters/public-conan)
-- Conan: Automatic detection of conan settings from cmake
-- Conan: Settings= -s;build_type=Release;-s;compiler=gcc;-s;compiler.version=7;-s;compiler.libcxx=libstdc++11
-- Conan executing: conan install . -s build_type=Release -s compiler=gcc -s compiler.version=7 -s compiler.libcxx=libstdc++11 -g=cmake --build=missing
CMake Error at cmake/conan.cmake:399 (message):
  Conan install failed='No such file or directory'
Call Stack (most recent call first):
  cmake/conan.cmake:485 (conan_cmake_install)
  CMakeLists.txt:49 (conan_cmake_run)


-- Configuring incomplete, errors occurred!


Running Xubuntu 18.04 LTS.

That is actually just the tool for managing the json data, so you don't have to do that by hand. It's only used for adding new sprites and stuff, so if you don't want to do that, don't build it, it's an optional target :)

I thought so. I just want the project to be as good as it can be before it makes it into distros, after which point it can be a couple years between each update.

I've also considered AngelScript. And i'm open for anything, but unless a nice contributor comes around, this is a feature for later. I'd say, that anyone who takes the task can decide the scripting language ^^

Democracy in action. AngelScript would be kind of a weird choice though because it uses some (optional) assembly stuff and isn't in the Ubuntu repos.
fluffrabbit
 
Posts: 493
Joined: 11 Apr 2019, 11:17

Re: Cytopia - A free, opensource city building game

Postby JimmySnails » 08 May 2019, 17:43

I'm sorry... it's -DUSE_PACKAGE_MANAGER


{l Code}: {l Select All Code}
cmake -DCMAKE_BUILD_TYPE=Release -DUSE_PACKAGE_MANAGER=Off ../Cytopia/


Works for me on Ubuntu. You might also need to install libnoise-dev package.

I just noticed that he just copied over the old text and forgot to add those flags. i updated the wiki. (it still needs some love though...)

You're right about the build folder. I created a folder for build related stuff and i personally always have my build folders parallel to the repository (git clean would delete it...) so i didn't think of that.
I have a huge list of stuff i want to refactor, i'll also change that when i get to that. It's also a good idea to have build instructions in the repo. I'll rewrite the wiki text first and add a HOWTO or someting :)

Thank you for your suggestions!

Regarding Angelscript, i just took a brief look at it and noticed it's C style. I also noticed that the documentation is quite... lacking. I'll keep your suggestions in mind. Btw, if you're interested in implementing one of those.... :D
JimmySnails
 
Posts: 19
Joined: 03 May 2018, 06:12

Re: Cytopia - A free, opensource city building game

Postby fluffrabbit » 08 May 2019, 20:43

It built! One more suggestion regarding the build process: Please don't capitalize the resulting executable as it goes against the conventions of case-sensitive operating systems.

A lighter alternative to libnoise might be stb_perlin.h, depending on which algorithm(s) Cytopia is using.

Running it... I like how the title fades in. I'm getting the tofu character in the text like so: CYTOPIA0▯1▯1ALPHABUILD

There is also a long delay whenever I click the rightmost icons at the bottom of the screen, after which I get a row of boxes with a red X in each of them. I don't know if this is part of the game or a bug. My guess is it could have something to do with how some of the images are capitalized and some aren't, but surely you have tested recently on a case-sensitive system so I don't know. No errors show up in the terminal.

Some work has piled up today, so sorry I can't be of more help quite yet.
fluffrabbit
 
Posts: 493
Joined: 11 Apr 2019, 11:17

Re: Cytopia - A free, opensource city building game

Postby Lyberta » 08 May 2019, 21:26

fluffrabbit {l Wrote}:Please don't capitalize the resulting executable as it goes against the conventions of case-sensitive operating systems.


Does it really matter when most people use mouse?

As for scripting language, I suggest WebAssembly, with that you can continue using sane languages such as C++ or Rust for your scripts. I'm gonna use it for my own engine and I'm in the middle of writing a VM for it.
⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧
User avatar
Lyberta
 
Posts: 594
Joined: 19 Jun 2013, 10:45

Re: Cytopia - A free, opensource city building game

Postby fluffrabbit » 09 May 2019, 01:03

C is a very sane language. My philosophy is: if modders want to mod, make them work for it. You really seem to be running with that idea. Without a compiler to WebAssembly, they will be MOVing and CPYing like real programmers.

The advantage I suppose would be that if a modder has a compiler suite, mods could be made that could be turned on and off without linking the object file with the executable. But you could also link object files with the executable and turn the mods on and off all the same. The WASM thing would be good if there were a mod downloader thingy, but I think mod downloader thingies are bad because I'm a backwards confused person who needs to take a nap...
fluffrabbit
 
Posts: 493
Joined: 11 Apr 2019, 11:17

Re: Cytopia - A free, opensource city building game

Postby JimmySnails » 09 May 2019, 07:15

Thx for testing :)

It built! One more suggestion regarding the build process: Please don't capitalize the resulting executable as it goes against the conventions of case-sensitive operating systems.


yay!
I'm not sure how other projects handle this, but where i work at, we create industrial multi-platform software, and the binaries are all starting with a capital letter. maybe because we use the product name abbrevation first... I'll have to take a look at other games, but i personally like the Cytopia starting with a capital letter :)

A lighter alternative to libnoise might be stb_perlin.h, depending on which algorithm(s) Cytopia is using.

I'm going to show it to the dev who is working on terrainGen, but it's going to be pretty complex when it's done and he's familiar with libnoise.

Running it... I like how the title fades in. I'm getting the tofu character in the text like so: CYTOPIA0▯1▯1ALPHABUILD

Thank you! We're also going to render a game map in the background later :)

Yeah, that's because of the font. it's missing a lot of characters and will be replaced by another one, but i didn't have time yet to do that. We're also going to replace SDL_ttf by a font texture atlas library for performance, but that's on the backburner too.

There is also a long delay whenever I click the rightmost icons at the bottom of the screen, after which I get a row of boxes with a red X in each of them. I don't know if this is part of the game or a bug. My guess is it could have something to do with how some of the images are capitalized and some aren't, but surely you have tested recently on a case-sensitive system so I don't know. No errors show up in the terminal.

Framerate breaks down as soon as you hover over ui elements. That's because i seriously messed up timer implementation (for tooltips). There's a ticket for that, but i'm working mostly on features needed for terrainGen at the moment. This is in the v0.2 milestone and will be fixed before the next release. TerrainGen wasn't initially planned for v0.2, but since a contributor showed up, and this is really an awesome feature, it's top priority for me at the moment.
And yeah, i've tested it on Ubuntu and on i'm using my very old debian laptop for performance tests. :)

Does it really matter when most people use mouse?

I'm also a shell-guy :D
but for the GUI users, i've added startmenu entries to the .deb / .rpm packages. I'm not familiar with those fancy new package managers, but someone requested a flatpack release. This is also planned for v0.2 release.
JimmySnails
 
Posts: 19
Joined: 03 May 2018, 06:12

Re: Cytopia - A free, opensource city building game

Postby JimmySnails » 22 May 2019, 09:55

So, what's going on with Cytopia?

I've updated our emscripten port at:
https://game.cytopia.net/

so you can check it out yourself. (no layers yet)


We're live on Itch.io:
https://cytopia.itch.io/

(Only windows for now)

Trees have been added to terrain gen and we've achieved a pretty awesome distribution of
Image

We also fixed a few things for macOS and working hard on the next release.
JimmySnails
 
Posts: 19
Joined: 03 May 2018, 06:12

Re: Cytopia - A free, opensource city building game

Postby fluffrabbit » 22 May 2019, 10:50

I would give this project a B, maybe a B+ in terms of structure and build system. About Godot's level, good enough that I don't mind building it, but not perfect enough that I fetishize it like my own code. For that reason, keeping the Emscripten version up-to-date makes me feel better about the project, because it is playable almost effortlessly on all the platforms that would potentially be supported.

I too use Emscripten, and I try to keep things working on my lowest-common-denominator Falkon browser that is slow, buggy, and currently lacks support for WASM and WebGL 2. That way even Internet Explorer users can play my games. Dunno what your philosophy is on this; better men have called me crazy as a result of my oldskool browser obsession, but it's something to keep in mind. Browsers are hard to maintain and I'd hate for everyone to be forced into Chrome/Firefox/Edge just like I'd hate for everyone to be forced into Windows/Mac.

Here are my Emscripten build flags for maximum compatibility:

{l Code}: {l Select All Code}
DATA_DIR=data
WEB_FLAGS=-s "EXTRA_EXPORTED_RUNTIME_METHODS=['Pointer_stringify']" -s WASM=0 -s ALLOW_MEMORY_GROWTH=1 --preload-file $(DATA_DIR)
WEB_SDL_CONFIGURE=emconfigure ../configure --host=asmjs-unknown-emscripten --disable-assembly --disable-threads --disable-cpuinfo CFLAGS="-O2"
SDL_DIR=SDL2-2.0.9


Obviously this is specific to my makefile and I'm building SDL from source with its configure script (somehow resulting in slightly smaller binaries than with cmake).

However, having now tested Cytopia in Chromium on a mid-range laptop that is somewhat old, I can confirm that it runs slooooooooow, so that, in my opinion, should be a higher priority. At a glance it's easy to see what could be causing the slowness: Lots of small tiles means lots of GL calls. Each GL call ties up the computer by crossing "the bridge" to the GPU. You need either sprite batching or render-to-texture for this kind of game.

Your renderer is sprite.cxx and it uses SDL_RenderCopy, which internally calls a glDraw command. Because you are not using OpenGL directly, your only optimization option (aside from zooming way into the map such that fewer tiles are rendered) is to render most of the tiles to a texture whenever the map is updated and just render that larger texture once per frame the rest of the time. You can overlay things like highlighted tiles on top of that.

Pseudocode:

{l Code}: {l Select All Code}
// Once per frame
DrawPrerenderedMapTexture();
// void Sprite::render()
if( highlightSprite == true ){
  SDL_SetTextureColorMod(m_texture, 150, 150, 150);
  if( clipRect.w != 0 ){
    SDL_RenderCopy(WindowManager::instance().getRenderer(), m_texture, &clipRect, &destRect);
  }else{
    SDL_RenderCopy(WindowManager::instance().getRenderer(), m_texture, nullptr, &destRect);
  }
  SDL_SetTextureColorMod(m_texture, 255, 255, 255);
}
fluffrabbit
 
Posts: 493
Joined: 11 Apr 2019, 11:17

Re: Cytopia - A free, opensource city building game

Postby JimmySnails » 22 May 2019, 16:52

Thank you for your kind words!

I would give this project a B, maybe a B+ in terms of structure and build system. About Godot's level, good enough that I don't mind building it, but not perfect enough that I fetishize it like my own code. For that reason, keeping the Emscripten version up-to-date makes me feel better about the project, because it is playable almost effortlessly on all the platforms that would potentially be supported.


What do you suggest to make the buildsystem better? With conan, building is a breeze now :) Without conan, it works as every normal open source project.

I didn't commit my emscripten changes yet, because the conan build is not working yet. (still working for the conan team to fix a few of the remaining issues i've submitted). We'll need to add libnoise, when we merge the terrainGen branch, and tbh i have no idea how to get that working with emscripten :- /

I too use Emscripten, and I try to keep things working on my lowest-common-denominator Falkon browser that is slow, buggy, and currently lacks support for WASM and WebGL 2. That way even Internet Explorer users can play my games. Dunno what your philosophy is on this; better men have called me crazy as a result of my oldskool browser obsession, but it's something to keep in mind. Browsers are hard to maintain and I'd hate for everyone to be forced into Chrome/Firefox/Edge just like I'd hate for everyone to be forced into Windows/Mac.


For now, i use emscripten more as a showcase. it doesn't support save / load game yet, and i don't know yet how to get the fullscreen button working (fullscreen works if you activate it through the gui though). I have almost no knowledge about emscripten, just followed their documentation and i was very happy when i got it working :)

Thanks for your flags! i use -O3 though and some other performance flags too. I think i create a second version without WASM. According to my hoster, WASM mime type is not supported. Also, the iPhone doesn't have WASM support and it's very slow there, so a non-WASM version might help.

If you like to help me out here with emscripten, that'd be very welcome, as i said, i have no experience with emscripten or webstuff at all...

However, having now tested Cytopia in Chromium on a mid-range laptop that is somewhat old, I can confirm that it runs slooooooooow, so that, in my opinion, should be a higher priority. At a glance it's easy to see what could be causing the slowness: Lots of small tiles means lots of GL calls. Each GL call ties up the computer by crossing "the bridge" to the GPU. You need either sprite batching or render-to-texture for this kind of game.

Your renderer is sprite.cxx and it uses SDL_RenderCopy, which internally calls a glDraw command. Because you are not using OpenGL directly, your only optimization option (aside from zooming way into the map such that fewer tiles are rendered) is to render most of the tiles to a texture whenever the map is updated and just render that larger texture once per frame the rest of the time. You can overlay things like highlighted tiles on top of that.



Before i implemented display resolution i spent quite some time, implementing a method to only call the render function of visible tiles. then i noticed that at 1080p / max zoom level almost everything is visible and removed that again....
I also talked to the guys in the SDL discord about rendering to one big texture. they suggested that it's a bad idea because of the graphics memory usage (maybe they just got me wrong?) idk... never tried it though.

For now, i'm still waiting for the next SDL2 release, as they finally added sprite batching. I've build the latest master and tried it. On linux, this tremendously improves performance. on windows, it crashes very often so i didn't add that to deployment yet.
OpenGL renderer is an option though that's something we'll work on (much?) later unless someone comes along and helps us out with that.

There are still quite a lot of things i have to add to the engine before we can release 0.2.
After the that release, i'd like to focus on adding some gameplay mechanics, improving road placement, adding zones. And finally start working on the UI design i have in mind. Let's get rid of those red X'es and replace them with the actual sprites of images :D

Btw, it also lags in emscripten with max zoom level on my brandnew laptop... :
JimmySnails
 
Posts: 19
Joined: 03 May 2018, 06:12

Re: Cytopia - A free, opensource city building game

Postby fluffrabbit » 22 May 2019, 21:08

What do you suggest to make the buildsystem better?

I don't know. With a clearer head I could probably give you a better answer to that. So far I'm just using regular makefiles and it "works for me". However, both cmake and scons are valid options if you want something more complex. Generally your build targets should include shared (for Linux distros), portable/static with in-tree sources or .a files copied in by hand, and (optionally) something like Conan for lazy idiot Windows users.

Emscripten compatibility is a primary reason to use header-only libraries, but generally the emconfigure, emcmake, and emmake tools should build non-Emscripten libraries just fine (assuming they don't call OS functionality like OpenGL, which I doubt libnoise does since it's just math).

Fullscreen is a bit tricky, and for the best experience you'll want to make your own HTML template that replaces the standard page via the makefile copying it into the web build folder and overwriting whatever is there. There is a bug preventing Emscripten from scaling a standard SDL viewport (OpenGL notwithstanding) to fit the browser window, so I would recommend leaving things as-is with regards to fullscreen and just improving the "theme" of the Emscripten page over those ugly green and white colors.

A non-WASM version would help with compatibility, but don't do it just because of your web host. If they've got server-side problems, they should be the ones to deal with them.

If you like to help me out here with emscripten, that'd be very welcome, as i said, i have no experience with emscripten or webstuff at all...

I would like to, though I'm not sure how much time I have for that or if I'll lose my ability to contribute due to life stresses piling up. I'm not in a good place right now at all, and I don't know if I'll survive it intact.

they suggested that it's a bad idea because of the graphics memory usage

They're idiots. You can go up to 4096x4096 without issue.

For now, i'm still waiting for the next SDL2 release, as they finally added sprite batching.

That's news to me. That will solve most of your problems. I would offer to help with the GL renderer except I don't think you'll need it if SDL supports sprite batching.

Let's get rid of those red X'es and replace them with the actual sprites of images

Yes please.
fluffrabbit
 
Posts: 493
Joined: 11 Apr 2019, 11:17

Re: Cytopia - A free, opensource city building game

Postby Lyberta » 23 May 2019, 09:45

fluffrabbit {l Wrote}:and (optionally) something like Conan for lazy idiot Windows users.


No, Conan is for everyone. Every modern language has package manager. Rust has Cargo, Python has pip, Ruby has Gems, Node has npm. Only C and C++ don't have one. And Conan is the best so far.
⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧⚧
User avatar
Lyberta
 
Posts: 594
Joined: 19 Jun 2013, 10:45

Re: Cytopia - A free, opensource city building game

Postby fluffrabbit » 23 May 2019, 10:25

The difference between C/C++ and Rust/Python/Ruby/Node is that C and C++ are used to protect state secrets, fly missiles, and run life support. The unreliability and lack of auditing with "loose" package managers makes Rust etc. unsuitable for those purposes, though I'm sure you'll try to find a counter-example. Even Go, a supposedly hip modern language, limits its packages to Git URLs you explicitly specify rather than a central package repo. In terms of the Steam crowd of course nobody cares about anything, but in the libre software world we build only bulletproof enterprise-grade software. ;)
fluffrabbit
 
Posts: 493
Joined: 11 Apr 2019, 11:17

Re: Cytopia - A free, opensource city building game

Postby JimmySnails » 23 May 2019, 12:49

Actually, you can also use your own repositories with conan. I'd never use online-repos with enterprise-grade software, only local mirrors.

Nevertheless, i also like it. On Opensuse there's no libnoise-dev package. conan takes care of that. And most importantly, i had a hell of a time to get Cytopia running on mac. It finally worked, but there was no audio support and i could not compile libnoise... at all... conan takes care of that too, and now the macOS version finally works the same as on the other platforms.

Besides that, it's also awesome for ports. I could build Cytopia for Android with it (result is a binary and no APK... i'm stuck for now ^^) and i also try to get it working with emscripten. It's pretty neat.

A non-WASM version would help with compatibility, but don't do it just because of your web host. If they've got server-side problems, they should be the ones to deal with them.

No, if i'll add this, i'm going to host both.
My hoster sucks... They closed my support ticket with "no, we don't support this mime type and it can't be added"... :-/


I would like to, though I'm not sure how much time I have for that or if I'll lose my ability to contribute due to life stresses piling up. I'm not in a good place right now at all, and I don't know if I'll survive it intact.

Sorry to hear that! :(
If you ever feel like doing something for Cytopia, i'd really appreciate it. No matter how small the contribution, everythings always highly appreciated.

That's news to me. That will solve most of your problems. I would offer to help with the GL renderer except I don't think you'll need it if SDL supports sprite batching.

https://www.patreon.com/posts/project-sdl-21856507

It got added to master quite a while ago, i hope they'll release an update soon.. That's really a big and helpful feature.
JimmySnails
 
Posts: 19
Joined: 03 May 2018, 06:12

Re: Cytopia - A free, opensource city building game

Postby fluffrabbit » 24 May 2019, 00:05

Actually, you can also use your own repositories with conan. I'd never use online-repos with enterprise-grade software, only local mirrors.

I didn't know that. It could help, but you would still need the code to be set up with Conan config files, which is just how things normally are but with extra seasoning. Maybe C++20 modules will alleviate some package modulatory problems, hopefully not at the expense of security (like with Java's classes).

i could not compile libnoise... at all...

But your job as a programmer is to get it compiling. I don't see what the problem is if libnoise has hardly any dependencies and just does logic/math stuff. I assume you can compile it as part of the Emscripten build, right?

I could build Cytopia for Android with it

Android is like Steam; the nobody-cares-about-anything mentality. There is of course F-Droid, and your package and build procedure would have to conform to their specifications.

and i also try to get it working with emscripten.

The Emscripten toolchain itself is a real pain because nobody seems to know what compiler features have or have not made it into upstream, so the Emscripten package ends up including an entire compiler suite, for now. If you can install Emscripten via Conan, that solves an actual problem that exists right now. As for installing dependencies like libnoise via Conan, that should not be necessary and it takes some of the magic away from compiling non-Emscripten code with Emscripten.

No, if i'll add this, i'm going to host both.

That's the way to do it. :)

If you ever feel like doing something for Cytopia, i'd really appreciate it. No matter how small the contribution, everythings always highly appreciated.

Thanks. After I posted that I put 14 hours into an attempt at getting Abuse running on Linux. It compiles and uses newer libraries now, but it segfaults when I try to run it. I guess you should take whatever I say with a grain of salt.

EDIT: Hell yes Abuse runs now! Just a good night's sleep was all I needed. I will be posting the new repo in the respective thread shortly.

https://www.patreon.com/posts/project-sdl-21856507

It got added to master quite a while ago, i hope they'll release an update soon.. That's really a big and helpful feature.

SDL is on Patreon now? That must be why they're adding high-level 2D features. I'm glad I have SFML set up as an alternate GL context initializer and input handler, as that is pretty much all I use SDL for and I don't need all the hipster sprinkles and fairy dust.
fluffrabbit
 
Posts: 493
Joined: 11 Apr 2019, 11:17

Re: Cytopia - A free, opensource city building game

Postby JimmySnails » 25 May 2019, 17:08

But your job as a programmer is to get it compiling. I don't see what the problem is if libnoise has hardly any dependencies and just does logic/math stuff. I assume you can compile it as part of the Emscripten build, right?


And my privilige as a hobby project is to not bother with that macOS sh*t.. i really don't like that OS...
You're right, it should be easy to compile, but the problem on mac is, that they use their own version of libtool. and i had no idea how to insteall glibtool (the gnu one) and i didn't want to bother. Conan does that for me and it does a good job. It can be compiled on windows + linux. And a "pro mac user" who doesn't want to use conan is smart enough to figure that out himself ;)

No, emscripten doesn't yet utilize libnoise. terraingen has been merged into master yesterday and there's no new emscripten build yet. Still waiting for the conan people to fix stuff i've submitted for emscripten. I need to read up more how i can compile it myself. as i said, total emscripten noob here :)

Thanks. After I posted that I put 14 hours into an attempt at getting Abuse running on Linux. It compiles and uses newer libraries now, but it segfaults when I try to run it. I guess you should take whatever I say with a grain of salt.

EDIT: Hell yes Abuse runs now! Just a good night's sleep was all I needed. I will be posting the new repo in the respective thread shortly.

The old DOS game?

Link! Now! :D

{l Code}: {l Select All Code}
SDL is on Patreon now? That must be why they're adding high-level 2D features. I'm glad I have SFML set up as an alternate GL context initializer and input handler, as that is pretty much all I use SDL for and I don't need all the hipster sprinkles and fairy dust.

No, unfortunately this is just a guys who did the sprite batching. If you take a look at his patreon, he's working on other non sdl projects too. mostly ports.
As you already noticed, my render code consists of "SDL_Rendercopy" calls... lol I also don't use more. I'd ike to use some basic shaders later, for "night mode"
JimmySnails
 
Posts: 19
Joined: 03 May 2018, 06:12

Re: Cytopia - A free, opensource city building game

Postby fluffrabbit » 25 May 2019, 20:53

So here's Abuse: https://github.com/fluffrabbit/Abuse_Linux

I hadn't heard about libtool. Upon reading about it, it sounds superfluous if you're building a static library because you just keep linking until you've got the full .a and then you put it into the executable and you're done. I guess libnoise hasn't been updated in 6 years or so, so it is what it is.

Still waiting for the conan people to fix stuff i've submitted for emscripten. I need to read up more how i can compile it myself. as i said, total emscripten noob here

Compiling Emscripten is like compiling all of Ubuntu. It's the entire software building toolchain that you would have on your GNU/Linux machine. It can't use what's already there because upstream GCC/Clang/whatever can be out of date (for now). If something you're doing requires patching Emscripten, I might recommend finding another way to do it. If it's just Conan-related stuff, then I don't know about it because I've never used it.

No, unfortunately this is just a guys who did the sprite batching. If you take a look at his patreon, he's working on other non sdl projects too. mostly ports.
As you already noticed, my render code consists of "SDL_Rendercopy" calls... lol I also don't use more. I'd ike to use some basic shaders later, for "night mode"

The thing about shaders is you can't just plug them in. GLSL takes inputs and outputs, and I won't bore you with details but basically you need to have a full GL renderer of your own to take advantage of that unless your library is very high-level. For instance, I think SFML might support shader effects, but porting to SFML would be almost as much work as writing a GL pipeline.
fluffrabbit
 
Posts: 493
Joined: 11 Apr 2019, 11:17

Re: Cytopia - A free, opensource city building game

Postby Hythlodaeus » 24 Jun 2019, 02:05

Finally got around to writing a proper article for this one. :)

https://freegamer.blogspot.com/2019/06/ ... topia.html

PS: you guys should advertise your project on the OpenTTD community, since you might benefit from interested developers and should also be able to use some of their graphical resources since they're all under GPLv2 license.
Hythlodaeus
 
Posts: 38
Joined: 26 Feb 2013, 14:04

Who is online

Users browsing this forum: Bing [Bot] and 1 guest