Coder Social home page Coder Social logo

yuv422 / cosmo-engine Goto Github PK

View Code? Open in Web Editor NEW
57.0 12.0 12.0 499 KB

A new game engine to play the MS-DOS game "Cosmo's Cosmic Adventure" on modern systems

License: GNU General Public License v2.0

CMake 1.93% C 95.98% C++ 2.09%
msdos game-engine apogee ega retro sdl2 game

cosmo-engine's Introduction

Cosmo-Engine

Windows: Windows Build Status Linux: Linux Build Status

A new game engine for playing Cosmo's Cosmic Adventure. Cosmo Engine

Requirements

A copy of the original Cosmo game is required to play.

Compiling

Cosmo-engine is built with CMake and requires SDL2 and SDL_mixer

cosmo-engine's People

Contributors

arcnor avatar ibara avatar yuv422 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

Watchers

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

cosmo-engine's Issues

add scaling support

HI! tested on linux! niceee! how to set it on fullscreen?.. I wont to do trashing "AKA tinkering" with your code to achieve it. video about it soon

xbrz support

Hi, I would love if you include this feature!!

I'd like to offer my resources toward this project

I independently decompiled all three episodes of Cosmo and released the work as a project called Cosmore. My goal was slightly different than yours -- I wanted to reconstruct the original code using the original compiler to get a DOS EXE. In the process I figured out a ton about what every variable and function does, and I tried to name things as descriptively as possible.

I realize that my project is of virtually no use to anyone who wants to run the game natively on modern systems, which is why I'd like to share my knowledge, experience, and even the code itself with your project. Anything you wish to incorporate, feel free. All I would ask for in return is attribution -- my name and a link back to Cosmore.

If nothing else, I'm always available for questions or discussions at the email address in my profile. I know this game pretty darn well now.

Can't quit

i can't exit the game every time i hit escape or q and y it just goes back between the title screen and main menu

Crashes on load, SDL_Free

For whatever reason, the game crashes when loading. I am compiling with Visual Studio 2022, for x64.

I hunted down the culprit in the form of:

SDL_free(fullpath);

Commenting out that in a couple of places did the trick. As to why that fixes things is an excellent question to which I don't have an answer at the moment ;).

Tried changing it to just free(fullpath); and that worked fine, not sure why the code is using SDL_free when it's not allocated by SDL, but hey. It's something.

not running on Pi4

i was able to build it correctly, i think. but when i try to run it i get 2 errors

NFO: Game controllers found: 0 Mappings: '/opt/retropie/ports/cosmoengine//gamecontrollerdb.txt' Count: -1
i have the gamecontrollerdb.txt in the wrong place, easy fix

cosmo_engine: /home/pi/RetroPie-Setup/tmp/build/cosmoengine/src/files/vol.c:127: vol_file_open: Assertion `open_vol_file(vol_filename, &vol_file)' failed.

this one i dont know hot to fix. the dir it is looking for the files is where the game was compiled in. once its done there it gets moved.

any thoughts

Controller support?

would controller support be available. or a list of controls so i can try to use joy2key?

Segfault in bonus level

To reproduce, collect 55 stars.
Enter the bonus level where you can jump from trampoline to trampoline from left to right until the most right side of the screen.
Then drop down and do not go in any exit but keep walking around and collecting items that are on the bottom and touching the green creatures.

I ran into a segfault there twice now. Here is what I get in GDB:

$ gdb ./cosmo_engine 
GNU gdb (Ubuntu 8.1-0ubuntu3.2) 8.1.0.20180409-git
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./cosmo_engine...(no debugging symbols found)...done.
(gdb) r
Starting program: /home/julius/checkouts/cosmo-engine/build/cosmo_engine 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffeac70700 (LWP 20755)]
[New Thread 0x7ffff7f93700 (LWP 20756)]
[New Thread 0x7fffea46f700 (LWP 20757)]
audio_init(): opened=1 times  frequency=22050Hz  format=S16LSB  channels=1
Failed opening './COSMO1.CFG'
Loading 228 status tiles.
Loading 750 player tiles.
Loading 1, player tile info records.
Loaded 4797 actor tiles.
Loading 267, actor tile info records.
Loading 2000 map bg tiles.
Loading 1000 map fg tiles.
Loading 1607 cartoon tiles.
Loading 1, cartoon tile info records.
Loading 100 font tiles.
Total Sfx 72
SOUNDS.MNI, 24, 0
SOUNDS2.MNI, 24, 23
SOUNDS3.MNI, 24, 46
Level 0: rain=0, backdrop_index=11, bg_x_scroll=64, bg_y_scroll=0, pal_anim_type=0, music_index=8
Loading 720 background tiles.
map width (in tiles): 512
Level 1: rain=0, backdrop_index=11, bg_x_scroll=64, bg_y_scroll=0, pal_anim_type=0, music_index=8
map width (in tiles): 512
Failed opening './COSMO1.SV1'
Failed opening './COSMO1.SV2'
Failed opening './COSMO1.SV3'
Failed opening './COSMO1.SV4'
Failed opening './COSMO1.SV5'
Failed opening './COSMO1.SV6'
Failed opening './COSMO1.SV7'
Failed opening './COSMO1.SV8'
Failed opening './COSMO1.SV9'
Failed opening './COSMO1.SV2'
Failed opening './COSMO1.SV3'
Failed opening './COSMO1.SV4'
Failed opening './COSMO1.SV5'
Failed opening './COSMO1.SV6'
Failed opening './COSMO1.SV7'
Failed opening './COSMO1.SV8'
Failed opening './COSMO1.SV9'
Level 3: rain=0, backdrop_index=13, bg_x_scroll=64, bg_y_scroll=128, pal_anim_type=0, music_index=10
Loading 720 background tiles.
map width (in tiles): 512

Thread 1 "cosmo_engine" received signal SIGSEGV, Segmentation fault.
0x000055555555f367 in map_get_tile_cell ()
(gdb) bt
#0  0x000055555555f367 in map_get_tile_cell ()
#1  0x000055555555aba8 in sprite_blocking_check ()
#2  0x000055555556d66b in actor_wt_green_roamer_worm ()
#3  0x000055555555a996 in actor_update ()
#4  0x000055555555aaa6 in actor_update_all ()
#5  0x000055555555eb54 in executeTick ()
#6  0x000055555555ec53 in game_loop ()
#7  0x000055555555b061 in main ()

This happened when touching a green creature (after having touched many already and collecting points). The first time it happened when as far as I could see I just jumped over an exit without touching anything special.

AmigaOS4 support

Hi Eric,

not sure if you want to, since it probably means some sort of adaptation/rewriting, but...

I tried to port your engine to AmigaOS4, but ran into some problems.

First there were compilation issues (since cmake doesn´t work on my platform, so i had to write my own makefile (attached). Luckily your cmake file is very clean and easy to adapt):

src/player.h:5:14: error: 'sint16' does not name a type; did you mean 'int'?
extern const sint16 player_x_offset_tbl[];
^~~~~~
int
src/player.h:6:14: error: 'sint16' does not name a type; did you mean 'int'?
extern const sint16 player_y_offset_tbl[];
^~~~~~
int
src/player.h:29:8: error: 'uint8' does not name a type; did you mean 'int'?
extern uint8 health;
^~~~~
int
src/player.h:30:8: error: 'uint8' does not name a type; did you mean 'int'?
extern uint8 num_health_bars;
^~~~~
int
src/player.h:32:8: error: 'uint16' does not name a type; did you mean 'int'?
extern uint16 num_bombs;
^~~~~~
int
src/player.h:33:8: error: 'uint16' does not name a type; did you mean 'int'?
extern uint16 has_had_bomb_flag;
^~~~~~
int
src/player.h:39:8: error: 'uint8' does not name a type; did you mean 'int'?
extern uint8 player_in_pneumatic_tube_flag;
^~~~~
int
src/player.h:46:8: error: 'uint8' does not name a type; did you mean 'int'?
extern uint8 show_monster_attack_hint;
^~~~~
int
src/player.h:48:8: error: 'uint8' does not name a type; did you mean 'int'?
extern uint8 word_28BEA;
^~~~~
int
src/player.h:73:28: error: variable or field 'display_player_sprite' declared void
void display_player_sprite(uint8 frame_num, int x_pos, int y_pos, int tile_display_func_index);
^~~~~
src/player.h:73:28: error: 'uint8' was not declared in this scope
src/player.h:73:28: note: suggested alternative: 'int'
void display_player_sprite(uint8 frame_num, int x_pos, int y_pos, int tile_display_func_index);
^~~~~
int
src/player.h:73:45: error: expected primary-expression before 'int'
void display_player_sprite(uint8 frame_num, int x_pos, int y_pos, int tile_display_func_index);
^~~
src/player.h:73:56: error: expected primary-expression before 'int'
void display_player_sprite(uint8 frame_num, int x_pos, int y_pos, int tile_display_func_index);
^~~
src/player.h:73:67: error: expected primary-expression before 'int'
void display_player_sprite(uint8 frame_num, int x_pos, int y_pos, int tile_display_func_index);
^~~
src/player.h:84:26: error: variable or field 'player_add_to_score' declared void
void player_add_to_score(uint32 amount_to_add_low);
^~~~~~
src/player.h:84:26: error: 'uint32' was not declared in this scope
src/player.h:84:26: note: suggested alternative: 'int'
void player_add_to_score(uint32 amount_to_add_low);
^~~~~~
int
src/player.h:88:110: error: 'uint8' has not been declared
void push_player_around(int push_direction, int push_anim_duration, int push_duration, int player_frame_num, uint8 dont_push_while_jumping_flag, int check_for_blocking_flag);

Those errors were was easily fixed by adding
#ifdef amigaos4
#include "files/defines.h"
#endif
to src/player.h, line 5

After the binary built i got more errors on start of the engine.
I cannot fix them by myself, too much of a noob i´m afraid, but i´d love to test anything you throw at me :-)

Here are the errors on start:

audio_init(): opened=1 times frequency=22050Hz format=S16MSB channel=1
ERROR: AUDIO_S16LSB or AUDIO_F32LSB required. found 0x9010
Failed opening: PROGDIR:/COSMO1.VOL
Error opening COSMO1.VOL
assertion "open_vol_file(vol_filename, &vol_file)" failed: file "src/files/vol.c", line 111
***Command 'cosmo_amigaos4' returned with unfreed signals 80000000!

I have to add that i´m using SDL2 on a Big Endian PPC-based machine

Makefile.amigaos4.txt

How to switch episodes

I have copied in the COSMO[23] .STN & .VOL however I am unable to switch episodes.
Has this not been implemented or is there something i'm missing?

I recall the DOS version has a different executable for each episode, i'm running on JelOS via portmaster.

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.