Egoboo Wii Port

The development of the game itself or new resources for it. Any new stuff you're working on would go here, as well as the discussion of in-development stuff.

Moderator: Developers

User avatar
Veiva
Acid Blob (New member)
Acid Blob (New member)
Posts: 18
Joined: Tue Feb 28, 2012 11:13 pm

Egoboo Wii Port

Post by Veiva »

Introduction
I am porting Egoboo to the Wii. This will be a lengthy and difficult process, but I'll try my best to get a reasonable port going. In order to play the Wii port, you will need a modded Wii (which is so easy to do these days...). Also, you will need a classic Wii (one that has GameCube ports, etc) in order to play at first. Classic controller support will come later.

Process
Currently, I am writing boilerplate code (initialization of the hardware). I also wrote some math classes: Vector3 and Matrix. These are based on my previous classes written in other languages, so they may be slightly bugged. I haven't done any tests on the code so far, but then again, I've only been programming a couple of days.

Links
You can get the current code at http://github.com/aaronbolyard/Egoboo-Wii

Conclusion
I will keep this thread up to date on my progress. Thanks for looking.
User avatar
penguinflyer5234
Sheep (Developer)
Sheep (Developer)
Posts: 3025
Joined: Wed Jul 23, 2008 1:39 am
Location: Best Southwest

Re: Egoboo Wii Port

Post by penguinflyer5234 »

So which version you are intending to port to the Wii?
...
User avatar
Veiva
Acid Blob (New member)
Acid Blob (New member)
Posts: 18
Joined: Tue Feb 28, 2012 11:13 pm

Re: Egoboo Wii Port

Post by Veiva »

I am intending to port the latest SVN, since it will have the most compatibility with the current Egoboo game.
bgbirdsey
{]-[0{0|307 (Developer)
{]-[0{0|307 (Developer)
Posts: 1864
Joined: Wed Jul 23, 2008 4:22 am
Location: Minnesota, USA

Re: Egoboo Wii Port

Post by bgbirdsey »

Interesting idea. I think it would almost be easier to make a completely new codebase which emulates egoboo and uses the egoboo resources.

For instance, almost all of the graphics code would have to be trashed and replaced with something that would interface with the wii graphics processor.
User avatar
penguinflyer5234
Sheep (Developer)
Sheep (Developer)
Posts: 3025
Joined: Wed Jul 23, 2008 1:39 am
Location: Best Southwest

Re: Egoboo Wii Port

Post by penguinflyer5234 »

That's what he's doing, according to this.
Veiva wrote:So, the reason I registered instead of lurking is to keep the community up to date on a major overhaul I'm attempting at the Egoboo codebase. If anything, it's more of a rewrite... I started recently and have written a few basic classes and so on (nothing to show except boilerplate code).

You may be going, "Hmm, isn't that silly? Why doesn't he contribute to the current Egoboo code?" The problem is I am going to rewrite it to use much less memory, for use in embedded devices. Also I'm going to attempt to make it much more modular.

"Embedded devices, you say?" The particular target I'm aiming for is the Nintendo Wii. In Egoboo's current state, the memory usage is just too high. Not only this, but it does not abstract the graphics API away, so it's impossible to simply port it in a short time span. The only feasible avenue is to completely rewrite large portions of it.
...
User avatar
Veiva
Acid Blob (New member)
Acid Blob (New member)
Posts: 18
Joined: Tue Feb 28, 2012 11:13 pm

Re: Egoboo Wii Port

Post by Veiva »

bgbirdsey wrote:Interesting idea. I think it would almost be easier to make a completely new codebase which emulates egoboo and uses the egoboo resources.

For instance, almost all of the graphics code would have to be trashed and replaced with something that would interface with the wii graphics processor.
That is exactly what I'm doing :)! I will write an emulation layer on a new extensible system that will allow for future plugins as well (e.g., different model formats, scripting languages, graphic APIs, etc...).
bgbirdsey
{]-[0{0|307 (Developer)
{]-[0{0|307 (Developer)
Posts: 1864
Joined: Wed Jul 23, 2008 4:22 am
Location: Minnesota, USA

Re: Egoboo Wii Port

Post by bgbirdsey »

Veiva, be sure that you follow gpl flavor. For instance, be downstream of an existing egoboo iteration...

Like I said, I would suggest emulating the features of egoboo but using a better scripting language and the native graphics features of the wii (for instance, I am sure that they offer some kind of native frustum culling and BSP support).

I am currently working on getting the code to be fully reentrant in C, with the idea if eventually porting to c++. Hopefully, I will have an update to the 2.8.x branch soon.
User avatar
Veiva
Acid Blob (New member)
Acid Blob (New member)
Posts: 18
Joined: Tue Feb 28, 2012 11:13 pm

Re: Egoboo Wii Port

Post by Veiva »

I updated the code to include the GPL preamble as well as the license. However, what exactly do you mean by being downstream of an existing Egoboo iteration? Sorry if I sound like an idiot, it's the first time I've contributed something outside of a small patch to an open source project...
bgbirdsey
{]-[0{0|307 (Developer)
{]-[0{0|307 (Developer)
Posts: 1864
Joined: Wed Jul 23, 2008 4:22 am
Location: Minnesota, USA

Re: Egoboo Wii Port

Post by bgbirdsey »

The GPL requires that your code be a "derived work" from a previous iteration of egoboo (if the development of egoboo were like a river this would be upstream of you), and that anything that you add or modify can be encorporated by someone else after you (in the same metaphor, you do not control anything downstream of you in the river).

I think this could be done even with completely unrelated code, if your intent was to emulate the features of egoboo, so don't worry too much.
User avatar
Zefz
Squirrel Knight (Administrator)
Squirrel Knight (Administrator)
Posts: 3820
Joined: Wed Jul 23, 2008 1:27 am
Location: Norway
Contact:

Re: Egoboo Wii Port

Post by Zefz »

Something like an irrlicht port of Egoboo (complete rewrite of the engine) would be interesting :)

I think Irrlicht is supported on many platforms (console, pc, etc.)
User avatar
penguinflyer5234
Sheep (Developer)
Sheep (Developer)
Posts: 3025
Joined: Wed Jul 23, 2008 1:39 am
Location: Best Southwest

Re: Egoboo Wii Port

Post by penguinflyer5234 »

There isn't a recent wii port of irrlicht. (the one I found is 3 years old with only 43 commits to their SVN)
...
User avatar
Veiva
Acid Blob (New member)
Acid Blob (New member)
Posts: 18
Joined: Tue Feb 28, 2012 11:13 pm

Re: Egoboo Wii Port

Post by Veiva »

Hey everyone,

I'd just like to say I made some major modifications. Last night I restaged my progress (basically, erased all work I did yesterday). However, out of this came a more elegant way of storing the model data for use with the Wii's graphics chip (see: Include/ElementArray.hpp). Today I'm hoping to load MD2 models; if not, at least I hope to manage texture loading for common formats (PNG, BMP, and TGA).

3/3/2012

Hey everyone #2,

It took slightly longer than anticipated to get textures working. They loaded fine, but I could not for the life of me render them. The problem is kind of obvious now, which makes me feel silly. I allocated a pointer and performed pointer arithmetic on it, losing the original pointer in the process. I now made it create a copy and perform the arithmetic on the copy, leaving the original alone:

Code: Select all

unsigned char * output = memalign(32, ...);

for(...)
  *output++ = data[...];

return output;

// vs
unsigned char * output = memalign(32, ...);
unsigned char * pixels = output;

for (...)
  *pixels++ = data[...];

return output;
Anyway, here is the result of texture loading and element arrays:

Image

Tomorrow I'll add a Model class and MD2 loading, which should be pretty easy since I have most of the low-level hard stuff done.
User avatar
Veiva
Acid Blob (New member)
Acid Blob (New member)
Posts: 18
Joined: Tue Feb 28, 2012 11:13 pm

Re: Egoboo Wii Port

Post by Veiva »

Hey again,

I have MD2 loading done and added a pooled allocator for efficient management of memory on the Wii. Normally memory would become fragmented after some time, leading to out of memory problems after a while (no chunk of the size available). Now memory is arranged into pools, which can be reset on level loading and so on, resulting in no fragmentation, regardless of time.

Anyway, here is Loggy on the big screen:

Image
bgbirdsey
{]-[0{0|307 (Developer)
{]-[0{0|307 (Developer)
Posts: 1864
Joined: Wed Jul 23, 2008 4:22 am
Location: Minnesota, USA

Re: Egoboo Wii Port

Post by bgbirdsey »

verrry niiice.

So, what are you going to do about the wii controllers? Any ideas?

At one time I had implemented 100% control from a gamepad, but that is not in the codebase at the moment.

Also, the codebase uses 100% redraw each frame instead of caching any of the dynamically created content (i.e. fonts). I have fixed this 2 different ways: 1 - "recording" the OpenGl commands.... kinda fail) and 2 - caching the SDL-generated font bitmaps and only recalculating when/if they change.
User avatar
Veiva
Acid Blob (New member)
Acid Blob (New member)
Posts: 18
Joined: Tue Feb 28, 2012 11:13 pm

Re: Egoboo Wii Port

Post by Veiva »

I am not sure about input yet... The Wii remote may provide enough buttons I'm smart about it, if the nunchuk attachment is used.

For my rewrite/port, I will be constantly referring to the Egoboo source from SVN. I am still writing a bunch of boilerplate code (e.g., file, memory, and low-level rendering) and still have a bit left (recreating std::vector, std::string, and std::map to use my custom pooled allocator). MD2 loading was implemented to test the allocator and rendering pipeline at the moment.

For fonts, I am going to cache it. Basically render each glyph onto an atlas of sorts. This keeps state changes to the minimum. I will be using FreeType directly for this, though.
Post Reply