Blade Brothers Engine: Creating my first 2D Game Engine

Anything related in any way to game development as a whole is welcome here. Tell us about your game, grace us with your project, show us your new YouTube video, etc.

Moderator: PC Supremacists

User avatar
eatcomics
ES Beta Backer
ES Beta Backer
Posts: 2528
Joined: Sat Mar 08, 2008 7:52 pm
Location: Illinois

Re: Blade Brothers Engine: Creating my first 2D Game Engine

Post by eatcomics »

Already did :D
Image
User avatar
LeonBlade
Chaos Rift Demigod
Chaos Rift Demigod
Posts: 1314
Joined: Thu Jan 22, 2009 12:22 am
Current Project: Trying to make my first engine in C++ using OGL
Favorite Gaming Platforms: PS3
Programming Language of Choice: C++
Location: Blossvale, NY

Re: Blade Brothers Engine: Creating my first 2D Game Engine

Post by LeonBlade »

Hello everyone,

It's been a while since I've posted here or on the site in general.
I've been going through personal stuff (aren't we all) and I haven't been motivated to do anything.

So far though, I've been trying to get back on track.
I'm trying to port what I have to the Wii and I'm running into issues loading the maps into memory on the Wii.
And, without a proper debugger, this is turning into a pain in the ass.

If anyone has any experience in Wii homebrew, please let me know.
I'll keep you updated on what I'm doing if you wish to know.
There's no place like ~/
User avatar
combatant936
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 39
Joined: Wed Jul 29, 2009 11:11 pm
Current Project: It's a secret!!
Favorite Gaming Platforms: N64, SNES, PS2, PC
Programming Language of Choice: C++, 65816 asm
Location: Pennsylvania
Contact:

Re: Blade Brothers Engine: Creating my first 2D Game Engine

Post by combatant936 »

LeonBlade wrote: If anyone has any experience in Wii homebrew, please let me know.
I'll keep you updated on what I'm doing if you wish to know.
No way I do!! xD AND I also had problems with the Wii at first for some reason...

What exactly is the problem? I had a hard time getting maps to work correctly for some reason.
User avatar
LeonBlade
Chaos Rift Demigod
Chaos Rift Demigod
Posts: 1314
Joined: Thu Jan 22, 2009 12:22 am
Current Project: Trying to make my first engine in C++ using OGL
Favorite Gaming Platforms: PS3
Programming Language of Choice: C++
Location: Blossvale, NY

Re: Blade Brothers Engine: Creating my first 2D Game Engine

Post by LeonBlade »

I'm getting DSI exceptions out the damn ass. I'm not sure why...
Image
There's no place like ~/
User avatar
combatant936
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 39
Joined: Wed Jul 29, 2009 11:11 pm
Current Project: It's a secret!!
Favorite Gaming Platforms: N64, SNES, PS2, PC
Programming Language of Choice: C++, 65816 asm
Location: Pennsylvania
Contact:

Re: Blade Brothers Engine: Creating my first 2D Game Engine

Post by combatant936 »

Yeah... that was my problem too... after some tweaking to my code though it went away.

Could I maybe see how you are loading your maps and initializing? Like not the file loading function itself, but like how you set up your main game function to load and initialize everything.
User avatar
LeonBlade
Chaos Rift Demigod
Chaos Rift Demigod
Posts: 1314
Joined: Thu Jan 22, 2009 12:22 am
Current Project: Trying to make my first engine in C++ using OGL
Favorite Gaming Platforms: PS3
Programming Language of Choice: C++
Location: Blossvale, NY

Re: Blade Brothers Engine: Creating my first 2D Game Engine

Post by LeonBlade »

Code: Select all

long lSize;
	size_t result;
	
	FILE* fileHandle = fopen(filename, "r");
	Log::LogControl.Write("Opening filehandle to open map file...\n");
	if (fileHandle == NULL)
	{
		Log::LogControl.Write("Error: fileHandle is NULL.\n");
		return false;
	}
	
	// read in the magic
	Log::LogControl.Write("Reading in magic...\n");
	fread(&magic, 4, 1, fileHandle);
	
	if (magic != 1179468354)
	{
		Log::LogControl.Write("Warning: Magic was not of the right type.\nMagic type found: %s\n", magic);
		// return false;
	}
	
	// read the header
	Log::LogControl.Write("Setting memory for the header...\n");
	memset(&mapHeader, 0x00, sizeof(MapHeader));
	if (&mapHeader == NULL)
	{
		Log::LogControl.Write("Error: %s\n", stderr);
		return false;
	}
	
	Log::LogControl.Write("Reading in the header...\n");
	result = fread(&mapHeader, sizeof(MapHeader), 1, fileHandle);
	Log::LogControl.Write("Result: %u\n", result);
	Log::LogControl.Write("Header info(for verification): Tiles X: %u & Tiles Y: %u\n");
	
	unsigned int tileCount = mapHeader.tilesX * mapHeader.tilesY;
	unsigned int tileBufSize = tileCount * sizeof(MapData);
	Log::LogControl.Write("Going to malloc mapData...\n");
	mapData = (MapData*)malloc(tileBufSize);
	if (mapData == NULL)
	{
		Log::LogControl.Write("Error: MapData couldn't be mallocated.\n");
	}
	
	// read in map data
	Log::LogControl.Write("Reading in mapData...\n");
	fread(mapData, tileBufSize, 1, fileHandle);
	
	fclose(fileHandle);
There's no place like ~/
User avatar
GroundUpEngine
Chaos Rift Devotee
Chaos Rift Devotee
Posts: 835
Joined: Sun Nov 08, 2009 2:01 pm
Current Project: mixture
Favorite Gaming Platforms: PC
Programming Language of Choice: C++
Location: UK

Re: Blade Brothers Engine: Creating my first 2D Game Engine

Post by GroundUpEngine »

Wii port? Ace bro! =)
User avatar
eatcomics
ES Beta Backer
ES Beta Backer
Posts: 2528
Joined: Sat Mar 08, 2008 7:52 pm
Location: Illinois

Re: Blade Brothers Engine: Creating my first 2D Game Engine

Post by eatcomics »

Thanks for asking that question Leon, I had this same problem first time I tried loading a Wii homebrew test... I went in edited some code and it worked fine but I have no idea why xD
Image
User avatar
combatant936
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 39
Joined: Wed Jul 29, 2009 11:11 pm
Current Project: It's a secret!!
Favorite Gaming Platforms: N64, SNES, PS2, PC
Programming Language of Choice: C++, 65816 asm
Location: Pennsylvania
Contact:

Re: Blade Brothers Engine: Creating my first 2D Game Engine

Post by combatant936 »

Yeah.. I'm not sure how to help with your specific problem but just try different things and see if it fixes itself.. I know that's crap but I mean that's what I had to do..
User avatar
LeonBlade
Chaos Rift Demigod
Chaos Rift Demigod
Posts: 1314
Joined: Thu Jan 22, 2009 12:22 am
Current Project: Trying to make my first engine in C++ using OGL
Favorite Gaming Platforms: PS3
Programming Language of Choice: C++
Location: Blossvale, NY

Re: Blade Brothers Engine: Creating my first 2D Game Engine

Post by LeonBlade »

Hahaha, no problem at all guys.
I didn't think you would be able to help me with this anyways.
I honestly have no idea what's wrong so... I don't know!

If only I had a debugger... I want to get it working across the network.
That's what those log calls are for, because I use them as a like stepping device to see where things went wrong.
Unfortunately, however, if it crashes none of the information is written out like it should be into the log.
There's no place like ~/
User avatar
eatcomics
ES Beta Backer
ES Beta Backer
Posts: 2528
Joined: Sat Mar 08, 2008 7:52 pm
Location: Illinois

Re: Blade Brothers Engine: Creating my first 2D Game Engine

Post by eatcomics »

Man that sucks, what do you mean across the network? Like loading the code through the network? Cause that would be cool
Image
User avatar
LeonBlade
Chaos Rift Demigod
Chaos Rift Demigod
Posts: 1314
Joined: Thu Jan 22, 2009 12:22 am
Current Project: Trying to make my first engine in C++ using OGL
Favorite Gaming Platforms: PS3
Programming Language of Choice: C++
Location: Blossvale, NY

Re: Blade Brothers Engine: Creating my first 2D Game Engine

Post by LeonBlade »

Debugging over a network.
Using GDB to debug over the Network
There's no place like ~/
User avatar
eatcomics
ES Beta Backer
ES Beta Backer
Posts: 2528
Joined: Sat Mar 08, 2008 7:52 pm
Location: Illinois

Re: Blade Brothers Engine: Creating my first 2D Game Engine

Post by eatcomics »

I see that's cool :D
Image
User avatar
LeonBlade
Chaos Rift Demigod
Chaos Rift Demigod
Posts: 1314
Joined: Thu Jan 22, 2009 12:22 am
Current Project: Trying to make my first engine in C++ using OGL
Favorite Gaming Platforms: PS3
Programming Language of Choice: C++
Location: Blossvale, NY

Re: Blade Brothers Engine: Creating my first 2D Game Engine

Post by LeonBlade »

We have lift off!
Image
Click here to see in a new page.

You'll notice no transparency... yeah... fucking Wii and it's transparency bull shit.
I'll work on that next :)
There's no place like ~/
User avatar
LeonBlade
Chaos Rift Demigod
Chaos Rift Demigod
Posts: 1314
Joined: Thu Jan 22, 2009 12:22 am
Current Project: Trying to make my first engine in C++ using OGL
Favorite Gaming Platforms: PS3
Programming Language of Choice: C++
Location: Blossvale, NY

Re: Blade Brothers Engine: Creating my first 2D Game Engine

Post by LeonBlade »

There's no place like ~/
Post Reply