New Game/Engine
#1
Posted 04 November 2005 - 04:43 PM
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:
HUMAN KNOWLEDGE BELONGS TO THE WORLD
#2
Posted 04 November 2005 - 06:34 PM
Actually, I'm looking forward to see your progress. Good luck! :yes:
#3
Posted 04 November 2005 - 06:53 PM
HUMAN KNOWLEDGE BELONGS TO THE WORLD
#4
Posted 05 November 2005 - 12:10 AM
#5
Posted 09 November 2005 - 10:21 PM
-//A texture Loader//-
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 :)
I await your comments, corrections, additions and everything you want to say :happy:
textureLoader.h
#include "FreeImage.h"
class textureLoader
{
public:
textureLoader(const char *fileName);
~textureLoader();
texInfo* info();
protected:
private:
const char *filePath;
FIBITMAP file;
struct textInfo
{
int width;
int height;
int size;
int nBPP;
int colors;
}sInfo;
};
textureLoader.cpp
#include "textureLoader.h"
#pragma once
textureLoader::textureLoader(const char *filePath)
{
fileName=filePath;
FreeImage_Initialise();
}
textureLoader::~textureLoader()
{
delete fileName;
}
textureLoader::info()
{
switch (FreeImage_GetImageType(fileName,0))
{
case FIF_BMP:
file=FreeImage_Load(FIF_BMP,fileName);
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:
file=FreeImage_Load(FIF_PNG,fileName);
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:
file=FreeImage_Load(FIF_JPEG,fileName);
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:
file=FreeImage_Load(FIF_TGA,fileName);
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:
file=FreeImage_Load(FIF_GIF,fileName);
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.
HUMAN KNOWLEDGE BELONGS TO THE WORLD
#6
Posted 09 November 2005 - 10:32 PM
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.
#7
Posted 09 November 2005 - 10:41 PM
Thanks again :)
P.S: Hope this won't became a flame war about how bad my code is :lol:
HUMAN KNOWLEDGE BELONGS TO THE WORLD
#8
Posted 14 November 2005 - 12:32 PM
Sorry for takeing it so much time but university tasks are very time consuming ones :)
HUMAN KNOWLEDGE BELONGS TO THE WORLD
#9
Posted 14 November 2005 - 07:21 PM
#10
Posted 14 November 2005 - 09:13 PM
HUMAN KNOWLEDGE BELONGS TO THE WORLD
#11
Posted 14 November 2005 - 09:15 PM
#12
Posted 19 November 2005 - 07:32 AM
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
#13
Posted 24 November 2005 - 05:20 PM
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
#14
Posted 24 November 2005 - 05:24 PM
Quote
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:
#15
Posted 02 December 2005 - 01:12 PM
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
HUMAN KNOWLEDGE BELONGS TO THE WORLD
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users












