A Qt based tile editor for editing TileData JSON files.
Scripting language for mods (like LUA)
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 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.
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.
mkdir new_build
cd new_build
cmake -DUSE_CONAN=OFF -DCMAKE_BUILD_TYPE=Release ..
-- 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!
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'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 ^^
cmake -DCMAKE_BUILD_TYPE=Release -DUSE_PACKAGE_MANAGER=Off ../Cytopia/
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.
Does it really matter when most people use mouse?
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
// 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);
}
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.
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.
What do you suggest to make the buildsystem better?
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...
they suggested that it's a bad idea because of the graphics memory usage
For now, i'm still waiting for the next SDL2 release, as they finally added sprite batching.
Let's get rid of those red X'es and replace them with the actual sprites of images
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.
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.
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.
Actually, you can also use your own repositories with conan. I'd never use online-repos with enterprise-grade software, only local mirrors.
i could not compile libnoise... at all...
I could build Cytopia for Android with it
and i also try to get it working with emscripten.
No, if i'll add this, i'm going to host both.
If you ever feel like doing something for Cytopia, i'd really appreciate it. No matter how small the contribution, everythings always highly appreciated.
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.
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?
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.
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.
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
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"
Users browsing this forum: No registered users and 1 guest