User Tools

Site Tools


devblogs:pokeparadox

PokéParadox's Development Blog

Revisiting Scaling

I want to go a little more in detail about what PenjinPrescale is actually doing. When scaling an image you have a few alternatives depending on the graphics API used and so on. In PenjinTwo I have included Scale2X if using SDL, you can change the display port size if using OpenGL/GLES and I also provide the option to use prescaling.

What is Prescaling

Prescaling is resizing the sprites/images at load time. PenjinTwo is setup to use states. In code written in this intended format you load the sprites when the state is created. While the sprite is loading if PenjinPrescale or PokeScale is active it will resize all images, text glyphs in this loading period.

How it Works

In the PenjinTwo config file you can set a BaseResolution which is the native resolution of your application. You can set this up in code an it will be written to the config on startup or shutdown. You can also set a Resolution which is a target resolution. From the BaseResolution and target resolution we can calculate a horizontal and vertical scale factor and using the scale factor we can ensure that all images are scaled correctly at load time (Using an optional smoothing filter).

How it affects game logic or physics

Generally I have tried to ensure that game logic is kept the same irrespective of the scaled output, where internal classes have been used, they know to take the scale factor into consideration. In some cases you may need to work around scaling problems and the scale factor can be obtained from the GPU object.

2014/08/05 11:45 · Kevin Winfield-Pantoja · 0 Comments

PenjinTwo Updates

Hi guys so it's been a long while and it seems I am sucking at keeping this blog of mine going. But in any case here is a new entry for you. I have finished a lot of work that means PenjinTwo is now compiled as separate modules and you can more easily pick and choose.

SimpleIni Waves Goodbye

I have also finished the major work to replace SimpleIni with a self- written INI file loader. I have a little bit of work to finish this but it works in the basic sense. Some of the things I need to continue with are avoiding unnecessary saving and also my idea for having a KEY_ID = VALUE system. That is for every KEY you can have an ID number to simplify things like level loading.

Multi Renderer Support

Took a lot of thinking to sort it all out but I've managed to figure out how to select the Renderer at runtime… although it's not quite working. This will eventually let you change a config file and pick GL/SDL rendering as you wish. Currently if you compile for GL and configure to use SDL it doesn't create the window properly… Hopefully some inspiration or suggestion from someone will help me progress this. Also the GL renderer has some weird bugs that I haven't any ideas about, at present.

Ad-supported

You may have noticed that Project Infinity has some advertisement banners and google custom search implemented. Well this was always the intended plan, but only recently have I found a way to implement it in a convenient way. This is just me trying to recover some of the costs involved in keeping this site open! If of course the advertisements bug you that much, please feel free to install Ad-block or similar!

MineCraft

The Pirate Games MineCraft server is doing reasonably well these days we are averaging 5 or 6 users per day. Please feel free to join us online:

Server IP 46.105.112.56:25578

Quad Cobble Generator Tutorial

SkyBlock - 01

You win some, You Lose some

RIOTdigital Tag-Team Coding Competition

Well it turns out I didn't win anything in the compo, but it was fun taking part, and there were some great titles produced. Congratulations to everyone that took part and to Uni for organising such a well run compo! PirateBaby was not finished for the compo but people did vote for it in this unfinished state, Thanks guys!

PokeScaler

I have previously been throwing some code together for an algorithm I've had in my head for quite a while. I showed some promise in my previous blog post. After the pressure of the compo subsided, I worked a little more on my scaling algorithm… rewriting it again! And this time I have results that are good enough to be included in PenjinTwo. It is an optional filter and is used in conjunction with the PenjinPrescale feature, whereby Sprites are rescaled at loadtime. I currently have a screenshot from the current build of PirateBaby.

Smooth Criminal

Big News!

Well hello there! I've been a busy bee as usual and my biggest news is I'm now a DAD! I have a healthy little boy. Well done Mrs PokeParadox! :D

PenjinTwo

So down to business, I have been rewriting Penjin from the ground up and made a fair bit of progress. I've made the code available on github. It uses the same simple approach but has the following new features:

  • Localisation support.
  • Data driven approach to frame-rate, resolution, colour depth and fullscreen/windowed settings.
  • New GUI options.
  • Can now compile as shared library.

The rewrite is also introducing cleaner, easier to maintain code and a better class hierarchy, removing copy-pasta code.

PirateBaby

PirateBaby is a virtual pet style toy and is progressing nicely and is by myself(code) and Dragons_Slayer(graphics), although many images are still place-holders. It is our entry for the RiOTdigital Tag-team Coding Competition.

I'm not sure if we'll be able to meet the deadline, but here is a newer screenshot.

Smoothing Filter

Finally in the last couple of days, I started working on a scaling/smoothing filter, intended scaling sprites. Today I got some nice images out of my attempts, but there are still some bugs as you will see below.

I currently doubt it could be used as a real-time filter, but the intended use is for pre-scaling sprites on image load.

The Blog that Time Forgot!

Well it would appear that I forgot to give you guys anything interesting to read again… Life has a tendency to have things happen and those things, coupled with actually using time to develop and such meant that I never got around to doing a blog post… yeah I know, excuses excuses.

PandoraPanic! Reflection

I think overall the project went well. Were there any things that I would do differently? Sure… if there wasn't then it wouldn't be much of a learning process. The important thing is that the result was the intended result. We managed to bring a nice, fun launch title for the Pandora made for and by the GP32X community.

Pirate Games

I've been looking into spiffing up the Pirate Games site 1) and basically I found a rocking CMS, Concrete5. This is a good immediate solution since we've had issue after issue getting a homepage that works.

Penjin

Penjin has seen some good progress since switching to being open-source, most of which during the development of PandoraPanic! and it is a completely usable project and already quite versatile. I had some chats with foxblock and we agreed that maybe it could some restructuring and tidying up… it has begun. I planned out a nice class diagram and have much of the structure reworked for the better. Also this is another chance it properly introduce Deoxygen comments so we can auto-generate the help manual… I now understand how it works a lot better so maybe, just maybe you guys will have some documentation as well as the live support I provide to anyone that asks!

Other Projects

Pirate Games has a few ongoing projects; MarkoeZ is still continuing his work on Panjoust, I'm still working on Biotix and have progressed things a little further… I have slowed down since I have some problems I need to figure out before continuing to plug away at the keyboard… Another project started is NovaKitsune which is basically on rails space shooter akin to classic StarFox, work has been done preparing code that is GL and GLES compatible and a basic model viewer and camera is done. Apart from that bugfixes, more bugfixes and real-life… so hopefully… now I can keep updating this thing better this next year…

2010/12/30 23:02 · Kevin Winfield-Pantoja · 0 Comments

Hi Blog! Remember Me?

So yeah it's been a long long while since I bothered writing anything here… but the problem is that I now use Twitter… And it's easier to quickly post micro-updates there. Anyway… down to brass tacks.

Penjin

Penjin is still progressing nicely, the SDL version is very usable and MarkoeZ and foxblock are putting it to some good use in their projects: PanDjoust and Wandor, respectively. Both are shaping up to be very promising games which use and demonstrate the tools that Penjin provides. The OGL back-end is recently getting some love, there have been a number of bugs fixed, including rotations. Work has been done to get the GL code to be ES1.x compliant and this is still ongoing.

PandoraPanic!

Foxblock has given us yet another mini-game recently, a follow the ball in the cup affair with the Pandora logo! I've been working with Pickle to try and iron out one remaining critical bug… he's got the hardware, I know my code… so it's kind of like email chess of bug fixing… The current problem is to do with angles and rotations2) And some games are rotating objects correctly and other aren't. This only occurs on the Pandora build…Very puzzling.

Secret Project

My “secret project” which I may have written about previously… I don't actually remember; Is in full swing. It is currently called Biotix and it will use OpenGL ES for rendering. It goes without saying that it will use Penjin too. Biotix is being written from scratch and is, in essence, a sequel to CromoZome. Code is in early stages, but I'm hoping to provide a game where the creatures actually evolve and interact. That's all I want to say currently, I'm hoping I can get a very early demo together soon.

It's Aliiiive! It's Aliiiive!

Intercontinental Debugging

Pickle has been a great asset in narrowing down the problem of getting PandoraPanic! to actually successfully start on the Pandora, although the situation did illustrate the problems of time zone and schedule differences. Pickle would ask me for the next function to step into and I would examine my code and see where to go next. It was kind of strange but we finally narrowed down the problem to the Music class.

Silly Bug

Whenever I get a bug like this that has me kicking myself, I do like to make a habit of pointing it out to others. It's not because I like to look like I make a lot of mistakes (which I do… I'm only human.) But it serves as a reminder to myself and others certain “gotchas” that you can fall into when writing code.

#ifdef #endif Dangers

The code was getting to around here before triggering an fpe.

    music.loadMusic("music/PandoraPanic_Title.ogg");
    music.setLooping(true);
    music.play();

Now this either meant that the music file wasn't being loaded properly (doubtful, but I checked with Pickle about the filename just to rule it out.) or the only other possibility was that SDL_Mixer wasn't being initialised properly.

I checked with my engine initialisation code and I was doing a call to Music.init() so it should be initialising… But looking into what Music.init() was doing…

#ifdef PLATFORM_GP2X
   Mix_OpenAudio(MIX_DEFAULT_FREQUENCY, AUDIO_S16, MIX_DEFAULT_CHANNELS, 128);			
#endif     
#ifdef PLATFORM_PC
   Mix_OpenAudio(MIX_DEFAULT_FREQUENCY, AUDIO_S16, MIX_DEFAULT_CHANNELS, 512);
#endif

we can see it is missing is code to initialise Audio on PLATFORM_PANDORA. This should illustrate the dangers of using #ifdefs and also wrapping library functions. It can be more convenient if you needs slightly different code to be compiled for different platforms 3) but it can obscure a problems.

Quick Fix

It should be noted that this code to initialise sound is very early code in my framework. Back then I didn't even know about the #elif preprocessor! As soon as I thought the sound initialisation was to blame I could see the problem with the code above. There is no fallback for the #ifdef. So I added one.

#ifdef PLATFORM_GP2X
   Mix_OpenAudio(MIX_DEFAULT_FREQUENCY, AUDIO_S16, MIX_DEFAULT_CHANNELS, 128);			
#elif PLATFORM_PC
   Mix_OpenAudio(MIX_DEFAULT_FREQUENCY, AUDIO_S16, MIX_DEFAULT_CHANNELS, 512);
#elif PLATFORM_PANDORA
   Mix_OpenAudio(MIX_DEFAULT_FREQUENCY, AUDIO_S16, MIX_DEFAULT_CHANNELS, 256);
#else
   Mix_OpenAudio(MIX_DEFAULT_FREQUENCY, AUDIO_S16, MIX_DEFAULT_CHANNELS, 512);
#endif

It Lives!

With that fix in place, PandoraPanic! is successfully running on Pandora hardware. The controls need to be mapped sensibly for the hardware, but currently I think SDL has some issues accessing the gaming buttons. So I'll have to map to some keys as a placeholder. I hope a playable version can be demoed soon.

Thunderbirds are Gooooo!

Well I thought it might be about time to make a little update here. I've been busy… really busy! A little tired/demotivated at times, but on the whole busy!

So Whatcha Been Doing?

SimpleJoy

SimpleJoy is generally finished now. It's perfectly usable. I spent a lot of time getting most of the common input types4) and the respective methods they supply inputs5) supported and mappable in the configuration scripts. That's a lot that's been done, but there's still a lot intended that can be done.

  • Multiple player support - Currently SimpleJoy only has the foundation for supporting multiple players/devices of the same type. You can set the device ID but it is just ignored right now.
  • Other input types - I want to add Wiimote support amongst other things, but I tend to focus on what is more relevant to the current project I'm using Penjin for. There are also devices I haven't supported that are supported by SDL_input, such as, track-balls.
  • Key Repeats - I keep saying I'm going to add this but keep forgetting… but basically it should be configurable and I really should stop procrastinating on this one.

PandoraPanic!

Things are coming a long nicely and there is many thanks to the Pandora release is having problems and being delays. Of course I want my Pandora NOW! but on the positive side of things, we are catching more bugs, adding more features and more mini-games. Some of the recent developments are:

  • New games from B-Zar - Memory Match and Rotating Turret. B-Zar also asked if I could add the sound effects that Gruso provided for the turret game.
  • Plander - You can actually land the rocket now!6) Also lots of collision fixes for both the rocket and the particles. It will soon be a playable minigame… I just hope I can get it finished for final release!
  • Pausing restructured - Pausing the game now idles the CPU a lot more, and is done by overloadable functions which are built into the base engine, instead of having to check if the game is paused everywhere. This change was thanks to suggestions from B-Zar. There is still some room for improvements, however.
  • MiniGame Previews - I'm quite proud of this and it appears to work well. It's a little hacky and needs the mini-game state to check whether it is a sub state or not. But it works. Basically the select screen can generate a preview of the mini-game and it doesn't need any screenshots in a folder. It simply sets up the state and renders the first frame and then resizes it down to 60% of the size and finally displays it. It does add a short delay since it has to process the state's init function and render the frame, but it's nothing intolerable.
  • Usual bugfixes - memleaks found, logic errors, redundant code, etc.

Recently the new test builds were uploaded and you can grab them here.

VirtualBox

I recently updated to the 9.04 release of Ubuntu and in turn the new release of VirtualBox. I must say, I'm really loving it. I am trying to get ReactOS working satisfactory, but it's still early days. I would just like a windows compatible OS to run in VirtualBox that I can test Windows builds of my projects in. In anycase I've gone for “a compact as possible” XP install. I installed the Guest Addition and the 3D Acceleration drivers and managed to compile an OpenGL test project, excellent. Very soon I'll be able to lessen the grip that Windows has over me, which is a great feeling. I just hope that the ReactOS team can bring their project to a more mature state, so that I can completely remove XP and just use WINE/ReactOS for anything Windowsy.

SimpleJoy KeyMapper

General Status

I have the setup to map devices supported through SDL, Buttons are mapped using Polymorphic classes which contain the SimpleJoy action and the relevant target key, which will trigger the SimpleJoy action.

The Tedium Factor

The current obstacle is handling all the possible mappings to SDLKeys. That is one for each key on the keyboard, and some of the special keys. Obviously some are not needed for the Pandora, but all bases will need covering, in case a USB keyboard is plugged in. Everything will need testing, but the code layout seems to make some sort of sense.

Further Plans

Ability to map to multiple USB controllers, Mice7) I also would like to provide some form of “pass-through” function for keyboard so that you can also use SimpleJoy to type, e.g. in an Name entry screen.

Yaaaaawn

The good

Just a mini update to say that I released a Penjin/PandoraPanic! snapshot. The links are on the PandoraPanic! page.

The Bad

There are not as many updates as I would like, but I have had trouble trying to fix my particle engine. I've had to revert changes four times or so. Very annoying.

The Ugly?

OK… that's not really the case, basically Dragons_Slayer is my new best friend, since he's been waving his magic wand and beautifying my mini game and the spites look amazing! We also have a new logo for Penjin itself:

PS

a Video update:

You could leave a comment if you were logged in.
devblogs/pokeparadox.txt · Last modified: 2008/11/21 00:14 by pokeparadox