# New Game/Engine

14 replies to this topic

### #1Cybrid

New Member

• Members
• 19 posts

Posted 04 November 2005 - 04:43 PM

Hi:

Well, I'm totally new to this forums, though I was in flipcode a long time ago.
I just wanted to say hello to everyone here, and tell that I'll be coding a RPG (and the engine) as a bachelor's final project. :happy:

I'll be releasing all the code as GPL when it's finnished, but by now I'll be posting here each part of the code as soon as I finnish it. For everyone to be able to use it, or correct me, or give ideas or.....

Hope you like it :yes:
/*Books, days and ways, gives men wisdom*/
HUMAN KNOWLEDGE BELONGS TO THE WORLD

### #2geon

Senior Member

• Members
• 939 posts

Posted 04 November 2005 - 06:34 PM

...flame you for making yet another rpg game. Well, at least it wasn't supposed to be MMO... ;-)

Actually, I'm looking forward to see your progress. Good luck! :yes:

### #3Cybrid

New Member

• Members
• 19 posts

Posted 04 November 2005 - 06:53 PM

Thanks for your support; I've been playing RPG's for years, so I just want to try a different approach to RPG, but I think that my true challenge is the engine :happy:
/*Books, days and ways, gives men wisdom*/
HUMAN KNOWLEDGE BELONGS TO THE WORLD

### #4Ed Mack

Senior Member

• Members
• 1239 posts

Posted 05 November 2005 - 12:10 AM

I really look forward to your code releases :)

### #5Cybrid

New Member

• Members
• 19 posts

Posted 09 November 2005 - 10:21 PM

***FIRST CODE RELEASE***

This is the first code release of my engine; it's a texture loader; only loader; I mean this class only loads the data from an Image file, I'm still writting the texture handler. It has been maid so you don't have to worry of the image format. It returns a pointer to a structure containing all the data you may need to know. I think it's easy to expand to add more data or other types of files. It uses FreeImage.

It's not finnished yet, I have to add some error control code and 2 or 3 thigs more, but this is how it is more or less :)


#include "FreeImage.h"

{

public:

texInfo* info();

protected:

private:

const char *filePath;

FIBITMAP file;

struct textInfo

{

int width;

int height;

int size;

int nBPP;

int colors;

}sInfo;

};



#pragma once

{

fileName=filePath;

FreeImage_Initialise();

}

{

delete fileName;

}

{

switch (FreeImage_GetImageType(fileName,0))

{

case FIF_BMP:

sInfo.width=FreeImage_GetWidth(file);

sInfo.height=FreeImage_GetHeight(file);

sInfo.nBPP=FreeImage_GetBPP(file);

sInfo.colors=FreeImage_GetColorsUsed(file);//palette size for palletised bitmaps, 0 for High colour's

sInfo.size=sizeof(fileName);

break;

case FIF_PNG:

sInfo.width=FreeImage_GetWidth(file);

sInfo.height=FreeImage_GetHeight(file);

sInfo.nBPP=FreeImage_GetBPP(file);

sInfo.colors=FreeImage_GetColorsUsed(file);//palette size for palletised bitmaps, 0 for High colour's

sInfo.size=sizeof(fileName);

break;

case FIF_JPEG:

sInfo.width=FreeImage_GetWidth(file);

sInfo.height=FreeImage_GetHeight(file);

sInfo.nBPP=FreeImage_GetBPP(file);

sInfo.colors=FreeImage_GetColorsUsed(file);//palette size for palletised bitmaps, 0 for High colour's

sInfo.size=sizeof(fileName);

break;

case FIF_TGA:

sInfo.width=FreeImage_GetWidth(file);

sInfo.height=FreeImage_GetHeight(file);

sInfo.nBPP=FreeImage_GetBPP(file);

sInfo.colors=FreeImage_GetColorsUsed(file);//palette size for palletised bitmaps, 0 for High colour's

sInfo.size=sizeof(fileName);

break;

case FIF_GIF:

sInfo.width=FreeImage_GetWidth(file);

sInfo.height=FreeImage_GetHeight(file);

sInfo.nBPP=FreeImage_GetBPP(file);

sInfo.colors=FreeImage_GetColorsUsed(file);//palette size for palletised bitmaps, 0 for High colour's

sInfo.size=sizeof(fileName);

break;

}

return sInfo *szTexInfo;

}

Best regards.
/*Books, days and ways, gives men wisdom*/
HUMAN KNOWLEDGE BELONGS TO THE WORLD

### #6Ed Mack

Senior Member

• Members
• 1239 posts

Posted 09 November 2005 - 10:32 PM

A few errors (ignoring the unfinished syntax) - the texInfo datatype (textInfo?) needs to be public. Also, you re-load the whole file each time info is called, even though the same data is returned. Why not load the image once per imageloader instance?

Deleting the pointer to some string data given to the function is probably a bad idea, unless you have a strange policy in your engine. Normally the callee deals with that, as it can manage the resource better.

In the loading section, you have identical code for most of the switch cases. Why not have one copy of that code after the switch?

One bigger issue is that the loader can only deal with simple direct filenames, you cannot use archives with your engine and such.

### #7Cybrid

New Member

• Members
• 19 posts

Posted 09 November 2005 - 10:41 PM

Ed Mack, thanks for the fast reply, I'll be checking what you've said, specially about loading textures from a resource file and other forms.

Thanks again :)

P.S: Hope this won't became a flame war about how bad my code is :lol:
/*Books, days and ways, gives men wisdom*/
HUMAN KNOWLEDGE BELONGS TO THE WORLD

### #8Cybrid

New Member

• Members
• 19 posts

Posted 14 November 2005 - 12:32 PM

I'm makeing the class to be able to load bitmaps from a resource (following neHe tutorials ;) ). And loading all bitmap's pixels. I hope to post the new version of the class this week.

Sorry for takeing it so much time but university tasks are very time consuming ones :)
/*Books, days and ways, gives men wisdom*/
HUMAN KNOWLEDGE BELONGS TO THE WORLD

### #9CobraLionz

Member

• Members
• 54 posts

Posted 14 November 2005 - 07:21 PM

Is this serious or a joke?

### #10Cybrid

New Member

• Members
• 19 posts

Posted 14 November 2005 - 09:13 PM

Why do you think this is a joke? :(
/*Books, days and ways, gives men wisdom*/
HUMAN KNOWLEDGE BELONGS TO THE WORLD

### #11Nodlehs

Valued Member

• Members
• 152 posts

Posted 14 November 2005 - 09:15 PM

He seems pretty serious to me. I don't know what would make you think this is a joke.

### #12simongcc

New Member

• Members
• 3 posts

Posted 19 November 2005 - 07:32 AM

Hello! I am new here too.
Nice to meet you all.

My suggestion towards your engine is, if possible,
please make it support international language including Asian languages such as Chinese and Japanese.
Because I am finding for a 2D RPG engines. Up to now, I have not yet found an engine that can support Chinese or Japanese.
Maybe in technical terms, make the editor and font system support unicode.
I am personally not a programmer. If I have made any mistake, please correct me. :)

Thanks!
Simon

### #13XORcist

Member

• Members
• 39 posts

Posted 24 November 2005 - 05:20 PM

what do you mean making an engine ?
Did u mean writing a rendering engine ?

I dont mean to discourage or something but,
Solo coding a game engine is suicide at its best.
And for a college project ?

If ur goal is just for the sake of your project then
my suggestions are ( assuming an year of coding )

1) A game engine is not just rendering textured triangles.
There is much more to it. I would recommend you to concentrate
on just one aspect of it, render. Work on it and make
it good.

2) Toughest part of engine development is bringing all the sub-systems
together and making them work in harmony.
If you have'nt done any game coding before, dont wast much time
in writing frameworks for all the sub-systems and design the entire thing.

3) Forget about Localization and all that stuff ( unless ur gonna write a full game and ship it world-wide)

4) Writing an editor ( 3d-engine editors like q3 radiant, unrealed ) is a beast of a project of its own. You could use quake3 radiant for building worlds level creation( u also get bsp, pvs & lightmaps). max, maya, milk-shape etc, for meshes & characters.

Online tutorials & articles are good resources, but, I recommend some game-development (engine -development ) beginner books.

Happy coding buddy, Welcome to the club

:yes:

xorcist

### #14XORcist

Member

• Members
• 39 posts

Posted 24 November 2005 - 05:24 PM

Quote

He seems pretty serious to me. I don't know what would make you think this is a joke.

it looked like gathering tutorial code samples ( Nehe texture tutorial) and merging em all to make an engine. I think thats the reason for 'is this a joke' thing. I kinda had the similar doubt, at first.:sneaky:

### #15Cybrid

New Member

• Members
• 19 posts

Posted 02 December 2005 - 01:12 PM

It's no joke guys :) , I'll try to do my best and if I can to share my code with people. I know I'm not a good coder but I consider this a great way of learning new skills.

In other things, the class of textureLoading is growing cause I'm adding code to be able to load from a single file, an array of files, and a zip file. It'll be tested before posting it here , and I hope it to be usefull to anyone trying to learn as me.

And thanks to all of you that have given me your support :D
/*Books, days and ways, gives men wisdom*/
HUMAN KNOWLEDGE BELONGS TO THE WORLD

#### 1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users