The shoutbox is currently out of service. Join us on Discord instead.
You can help CodeWalrus stay online by donating here.

nKaruga, PC demake of Ikaruga (ported from TI-Nspire)

Started by matrefeytontias, September 15, 2015, 05:35:07 pm

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

matrefeytontias

TODO : write this when the PC port is 100% fixed and to the level of the Nspire version

Spoiler: ShowHide
My TI games (some got their own article on non-calc websites !) : http://www.ticalc.org/archives/files/authors/112/11202.html

My moozik (100% free metal) : http://www.soundcloud.com/matrefeytontias

DJ Omnimaga

The entire game now just shows a Trollface O.O?

Just kidding, I would be very interested into playing a nKaruga version for PC. Will music (if any) have a retro feel like Sega Mega Drive? Also will graphics remain the same, scaled up for those who wants to play Full screen?

Good luck! (Also I am cloning this topic in the non-calc section so it shows in both :walrii: )

matrefeytontias

All of the graphics (and the UI) will remain the same. Actually, the screen itself will still be 320x240, but scaled up twice so that it shows pixels and stuff, just like a retro console would :)
My TI games (some got their own article on non-calc websites !) : http://www.ticalc.org/archives/files/authors/112/11202.html

My moozik (100% free metal) : http://www.soundcloud.com/matrefeytontias

DJ Omnimaga

Awesome to hear. And yeah I noticed. I am amazed so far by the result and there is a news coming up. Some suggestions :)

-Key detection on title screen options is quite laggy. Sometimes it won't respond then it registers keypresses twice. It's perfectly fine inside the game
-Some text seems a bit cut off. For example the 1 digit misses some outlines at the top. Is that normal?
-An option to play at 1x, 3x, 4x or 5x scaling would be nice for people with different resolutions, perhaps also with an option to maximize the window while still having the game in the center with a black frame. That way we can play close to how we play SNES/NES emulator games :)
-Music, but it would need to sound old school or like video game stuff. Not necessarily chiptune-like but at least limited or with some electronic sounds. Maybe covers of my songs? :P

matrefeytontias

<yeah I posted a demo on IRC>

- the way I did it in the menus is just reducing the framerate to 10 FPS :P I was basically being a lazy ass, of course I'll switch to proper key-repeat handling in the (near) future.
- it appears that it's just because it reached the top of the window, thus having a line of pixels outside the screen. I'll fix that eventually.
- honestly, 1x is super tiny and over 3x is super huge ... I mean, the window is always a multiple of 320x240, so it gets insanely huge pretty fast. I'll eventually add a full-screen mode though, just to see what it looks like.
- Yeah well that's planned, but won't come anytime soon :P
My TI games (some got their own article on non-calc websites !) : http://www.ticalc.org/archives/files/authors/112/11202.html

My moozik (100% free metal) : http://www.soundcloud.com/matrefeytontias

DJ Omnimaga

Aah I see now. Reducing menu frame rate is definitively a good way to save on computer resources. ANd I see about the text.

As for 1x, it's more if for example someone has a small resolution on a very old computer, so it's not really that necessary. But 3x and 4x would be nice to have because on my 1920x1080 screen, 640x480 is very small. 4x would make it 1440x960 IIRC. Even 4x would be small on 4K. If you add a full screen mode, though, keep in mind that some video cards blurs images at low resolution.


Do you plan to put the demo and screenshots in the first post?

matrefeytontias

September 15, 2015, 09:45:56 pm #6 Last Edit: September 15, 2015, 10:48:27 pm by matrefeytontias
4x is 1280x960 actually. But yeah, I see your point, I'll implement that then.

Download the game on GameJolt : http://gamejolt.com/games/nkaruga-2d-ikaruga-demake/92026

Don't forget to read the instructions !
My TI games (some got their own article on non-calc websites !) : http://www.ticalc.org/archives/files/authors/112/11202.html

My moozik (100% free metal) : http://www.soundcloud.com/matrefeytontias

DJ Omnimaga

Is it an update of the demo you posted on IRC? Just wondering in case I need to update.

EDIT: Aw, shame that your Gamejolt description makes absolutely zero mention of TI calculators :(

gameblabla

September 16, 2015, 12:58:25 am #8 Last Edit: September 16, 2015, 01:01:39 am by gameblabla
Matref, there's a reason why things like SDL2 or SDL_gfx exists :
Use them for screen scaling !

For SDL_gfx, it works like this :
You detect the resolution with SDL_GetVideoInfo.
You store the detected resolution somewhere and you tell SDL_SetVideoMode to take all the screen.
Next, you create a RGB Surface with the game's native resolution.
Make sure that your game draws to the RGB Surface instead of the screen.

That's how i do it (the game's native resolution here is 320x240) :

#ifdef SCALING
const SDL_VideoInfo* info = SDL_GetVideoInfo();
scale_w = info->current_w / 320;
scale_h = info->current_h / 240;
 
scale_w_total = scale_w * 320;
scale_h_total = scale_h * 240;

screen_position.x = (info->current_w - scale_w_total)/2;
screen_position.y = (info->current_h - scale_h_total)/2;

real_screen = SDL_SetVideoMode(info->current_w, info->current_h, info->vfmt->BitsPerPixel, SDL_HWSURFACE | SDL_NOFRAME);
screen = SDL_CreateRGBSurface(SDL_HWSURFACE, 320, 240, info->vfmt->BitsPerPixel, 0,0,0,0);
#else
screen = SDL_SetVideoMode(320, 240, 16, SDL_HWSURFACE);
#endif


Then for drawing everything on-screen :


#ifdef SCALING
SDL_Surface* doble;
doble = zoomSurface(screen,scale_w,scale_h,0);
SDL_BlitSurface(doble,NULL,real_screen,&screen_position);
SDL_Flip(real_screen);
SDL_FreeSurface(doble);
#else
SDL_Flip(screen);
#endif


EDIT: My solution here works with all screens but if you like your upscale code better,
it's up to you really.

DJ Omnimaga

Would those routines allow him to use actual full screen modes?

gameblabla

September 16, 2015, 01:19:46 am #10 Last Edit: September 09, 2016, 05:33:07 am by gameblabla
Quote from: DJ Omnimaga on September 16, 2015, 01:11:28 am
Would those routines allow him to use actual full screen modes?

It' works with fullscreen modes with no issues but fullscreen is evil, especially on Linux.
This code has no need for fullscreen and my code here actually runs on a window without borders,
which works better on operating systems like most linux distributions.

EDIT: Also matref, i forgot to tell you that but you need to get the bpp using SDL_GetVideoInfo
and you need to use the detected bpp for your RGB Surface and screen surface or else SDL will have to do some conversion,
wasting a lot of cpu cycles.

DJ Omnimaga

I guess it's fine if it's simulated full screen, as in the game just stretched to fit everything on screen without changing the resolution. However, it has to be optimized a lot because in the past I saw 2D games or emulators lag like mad when the window was stretched up to high resolutions.

Streetwalrus

September 16, 2015, 06:35:38 am #12 Last Edit: September 16, 2015, 07:29:28 am by Streetwalrus
Quote from: gameblabla on September 16, 2015, 01:19:46 am
It's works with fullscreen modes with no problems but fullscreen is evil, especially on Linux.

Wait what ? On Linux, full screen = borderless extended to the whole screen. It's just a flag that tells the window manager to do that. There's nothing wrong with this, if it doesn't work for you then your window manager is broken. You smoked too much Windows man. :P

DJ Omnimaga

Actually on Windows it's not that bad either unless you use Visual Basic 6.0 or downloaded stuff from Limewire at least once.

matrefeytontias

September 23, 2015, 08:56:47 pm #14 Last Edit: September 23, 2015, 08:59:43 pm by matrefeytontias
Alright, level 2 is now able to progress pretty fast (weird sentence huh). I'm done writing the props engine (which is actually embedded in the enemies engine) and the camera paths handling, which I'm pretty proud of. Nearly everything in nKaruga works with callbacks, making everything pretty modular.

Anyway, now that that's out of the way, I should be able to work fast on level 2. It's actually pretty good already !



As always, if you want to help with sprites, I need that, so please tell me. Thanks in advance !
My TI games (some got their own article on non-calc websites !) : http://www.ticalc.org/archives/files/authors/112/11202.html

My moozik (100% free metal) : http://www.soundcloud.com/matrefeytontias

Powered by EzPortal