Coder Social home page Coder Social logo

fallahn / crogine Goto Github PK

View Code? Open in Web Editor NEW
79.0 4.0 12.0 671.19 MB

SDL2 Based Game Framework

C++ 57.01% C 40.72% Objective-C 1.01% CMake 0.25% Java 0.35% C# 0.05% Perl 0.11% Python 0.50% Objective-C++ 0.01%
gles2 sdl2 android windows linux game-framework

crogine's People

Contributors

fallahn avatar gingerbeardman avatar jonnyptn avatar refalm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

crogine's Issues

Counterintuitive swing control

I am playing this for the first time, and just can not figure out the swing control. I experimented with multiple possible interpretations of how this maybe supposed to work, but none of them produce the result I am expecting.

On the first space bar press the power goes up, and it stops going up in the second press. This is very easy to understand, but the third space bar press makes no sense at all. I thought the idea was to let it bounce off the right hand side and press space again on the way back down when it gets to the middle. If I do this however, the black vertical bar continues moving left for a while after pressing the space bar, and it always hooks the ball way over to the left.

How is this supposed to work?

macOS: Post process effects do not render.

Screen output is black. See the threat_level example. Both menu and in-game states render the 3D scene as all black (which use the post-process effect pass) but UI elements render OK. Tested on 2012 mac mini, intel HD4000, 10.14 Mojave.

macOS: Shadow maps aren't rendered

See batcat sample. Animated character should be casting shadows on the ground. Tested on 2012 mac mini, intel HD4000 GPU, macOS 10.14 Mojave

How does the Sprite Editor Work?

Hi,
I'm trying to use the sprite editor to generate a sprite sheet but it does not render anything,

image

Do you have a way of creating sprite sheets? the format is quite custom.

Windows 10 display scale

I just purchased the game on Steam and installed on Windows 10 Microsoft Surface Pro 4.

I went into the game settings and set the resolution to slightly less than my screen resolution, and the game became much larger then the screen, the menu disappeared off the bottom of the screen and I could no longer navigate to change the resolution back. I tried quitting the game with Alt-F4 and restarting it, but it remembered the resolution. I thought I was going to have to uninstall/reinstall to fix it.

I double checked my screen resolution in the Windows 10 display settings, and noticed that the scale was set to 225%. I tried reducing this to 100% and now the game fitted on the screen and became playable again.

I think your game should either ignore the display scaling, or take it into account when presenting the resolution options. Right now it's very easy to get stuck in a place where the game is unusable and the solution is not obvious.

Please add very simple sound effect to the test game TL

Hi fallahn,

Please can you add very simple sound effect to the test game Threat Level.

To keep it super simple, maybe initially, same weapon_fire sound to events:
*Level start
*New spawn
*Weapon fired
*PlayerShip Died

Thanks!

Flip 2D Sprite

Hi,
In xygine it was possible to flip a sprite by setting the transform to a negative number. When I try to do the same in crogine, the sprite disappears.

Thanks

Is crogine a replacement of xygine?

Hi,
I've been testing both engines lately and both have almost the same API (porting cide fron xygine to crogine is basically copy pasting).
Development on Xygine seems yo have been stopped. Are You still maintaining both, or is it better to just use crogine?

Text alignment and cropping is broken

Scissor calculation when updating the text system is broken since the font/text refactor. Centre and right justification alignment is also incorrectly calculated.

SDL headers are leaked

Noticed this while updating the golf cmake to use modern target-based include directories - Types.hpp includes SDL headers, so any project using crogine will also need the SDL include paths set up.

Perhaps some forward declarations or using a pimpl would mean we can avoid this requirement and "hide" the SDL implementation from crogine users

High resolution icon on Mac is overridden by Lower res one

This relates to Window::setIcon - I think on Windows this relates to the tiny icon in the top left of the window so a low res image works fine, but on Mac it actually sets the icon in the doc which is much higher resolution so using the same image for both looks rubbish on Mac.

This also overrides the higher res .icns file which is part of the mac bundle so it means the app looks great in the doc until you launch it, at which point it changes to the low res version.

I expect most of this behaviour is dictated by SDL_SetWindowIcon so not sure how much control we have, but I'd guess the solution is to either use a higher resolution image (would need to check how that appears on windows) or to bypass the function on mac builds. I'd say the former is better if possible

Building on macOS?

  • Maybe I need to adjust my path or symlink something?
  • After this I can provide the macOS Apple silicon build :)
❯ cmake .
-- The C compiler identification is AppleClang 14.0.0.14000029
-- The CXX compiler identification is AppleClang 14.0.0.14000029
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
<FindSDL2.cmake>
</FindSDL2.cmake>
-- Found SDL2: /Users/matt/Library/Frameworks/SDL2.framework;-framework Cocoa  
-- Found Freetype: /Library/Frameworks/freetype.framework (found version "2.12.1") 
-- Found OpenGL: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/System/Library/Frameworks/OpenGL.framework   
-- Found OpenAL: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/System/Library/Frameworks/OpenAL.framework  
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/matt/Downloads/2023-02-23/crogine-golf-v1.10.0
❯ make
[  0%] Building CXX object crogine/CMakeFiles/crogine.dir/src/audio/AudioBuffer.cpp.o
[  1%] Building CXX object crogine/CMakeFiles/crogine.dir/src/audio/AudioMixer.cpp.o
In file included from /Users/matt/Downloads/2023-02-23/crogine-golf-v1.10.0/crogine/src/audio/AudioMixer.cpp:30:
In file included from /Users/matt/Downloads/2023-02-23/crogine-golf-v1.10.0/crogine/include/crogine/core/App.hpp:34:
/Users/matt/Downloads/2023-02-23/crogine-golf-v1.10.0/crogine/include/crogine/core/Window.hpp:39:10: fatal error: 'SDL_atomic.h' file not found
#include <SDL_atomic.h>
         ^~~~~~~~~~~~~~
1 error generated.
make[2]: *** [crogine/CMakeFiles/crogine.dir/src/audio/AudioMixer.cpp.o] Error 1
make[1]: *** [crogine/CMakeFiles/crogine.dir/all] Error 2
make: *** [all] Error 2

macOS: Skyboxes do not render

The cube-map skyboxes which are enabled with Scene::enableSkybox() or Scene::setCubemap() render black. See the multiplayer_game sample. Tested on 2012 mac mini, intel HD4000 GPU, macOS 10.14 Mojave

Golf: thoughts

thoughts... in order of seriousness

  1. make sure golf ball, shadow, flag/pole-shadow are always big enough to be visible
    • these can disappear or flash on/off depending on resolution you're running at, making it difficult to follow the action, watch the ball and shadow in this clip https://imgur.com/a/SapDWZs
  2. hook & slice seem to be the opposite of what I expect?
    • i'd expect hitting right of the centre marker to curve the ball left, and vice versa
  3. contrast of power meter on shadow when over bunker is low
    • certain points on the green/yellow/orange/red of the power meter are very close to the yellow of the sand with the shadow of the ui on it, which means the power meter disappears at times during the most important time when you are trying to set power
  4. speed up or switch off animations
    • speeding up the ball flight animation would be useful so i don't have to wait for ball to come to rest, I picked up this habit from Links 2004 and it was even possible as far back as New 3D Golf Simulation on MegaDrive ~1993
    • turning off or speeding up the morphing animations would also be good. the first time they are cool, the more i see them the more i want to skip them
    • there are pauses where nothing is happening on screen yet i am not in control, and have to wait for some other animation to happen
    • there's more time spent watching or responding to the ui than there is playing golf shots
  5. turn off stroke notification
    • again so there is less delay between shots, might make sense only in single player?
  6. option to turn off gimme
    • or let me see how close my approach was before calling it

How to build that? :O

CMake Error at C:/Program Files/CMake/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find CROGINE (missing: CROGINE_LIBRARIES CROGINE_INCLUDE_DIR)
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  samples/cmake/modules/FindCROGINE.cmake:10 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  samples/golf/CMakeLists.txt:59 (find_package)

Unbuildable at all :|

Is there any magic combination to run it? I’m a beginner, I haven’t yet worked 90 years in production with the C language, so the build instructions are like : "well, here’s a source, you know what to do..." - it’s a little bet short

I also tried to build it by Visual Studio 2022 and there is no one binary file at all, only .obj files everywhere :|
I also tried to go to a local fortune teller, a shaman and a monastery, but their wisdom did not help me understand your idea

why crogine is not based on SFML?

Hello. I'm newbie in programming and I've installed SFML yesterday. I saw your xygine game engine is based on SFML and does NOT support mobile devices and 3d , but your crogine game engine that is based on SDL2 supports mobile devices and 3d. now I think that SDL2 is better than SFML in mobile and 3d programming. is it true?
based on your library selection for your engines I think I must choose SDL2 for mobile and 3d and not SFML.

Golf: failed to connect to local server/creating server host

Repro

  1. check port 16002 is open
  2. create game or choose tutorial

Expected

  • game created

Actual

  • error
  • this leaves me unable to play the game 😩

image

Port

  • open

Screen shot 2023-02-24 at 13 26 40

Tried

  • turning off firewall

Affected

  • custom macOS Apple silicon build
  • itch macOS Intel build

setKeyRepeatEnabled

Hi,

xygine has a function called setKeyRepeatEnabled which can be used to avoid firing events when a key is pressed. It is used in the following way:
getRenderWindow()->setKeyRepeatEnabled(false);

Does crogine has something similar?
Right now if I left a key pressed, it keeps firing KEY_DOWN events.

Particle System

Hi,
Does the particle system works with an ortographic camera?

I've been trying to use the particle system with a 2d game but I'm not able to render any particles.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.