Page 3 of 8

Re: Questions about loading maps and check out my new project!

Posted: Thu Apr 01, 2010 1:09 pm
by mv2112
avansc wrote:
GroundUpEngine wrote:Hmm, well if it works without the dll, then it must be statically linked by default. btw I'm just guessing ;)

p.s. I prefer to statically link as many libraries I use as possible, so my program's directory isn't full with dll's however the file size is always alot larger.
in windows the exe will look for libraries in 2 places, unless otherwise specified in the code. first it will look in the local directory, then in system32 or whatever its called these days. id first go look to see if the dll is not in that directory either.
I looked in system32 and the project directory, no lua dlls

Re: Questions about loading maps and check out my new project!

Posted: Thu Apr 01, 2010 5:26 pm
by mv2112

Re: Questions about loading maps and check out my new project!

Posted: Fri Apr 02, 2010 12:12 am
by eatcomics
LUA!!!!!!!!!!11111111111111 but fucking rape youtube, then leave it on the corner like a dirty hooker

Re: Questions about loading maps and check out my new project!

Posted: Fri Apr 02, 2010 12:42 am
by mv2112
eatcomics wrote:LUA!!!!!!!!!!11111111111111 but fucking rape youtube, then leave it on the corner like a dirty hooker
I HATE vector<object*> thingy!!!!!!
THIS IS WHY:

Code: Select all


thingy.push_back(new object);
delete thingy[0];
//DOESNT WORK!!!
I just spent hours trying to figure out why!!!! THIS IS WHY!!!!

Code: Select all

thingy.push_back(new object);
delete thingy[0];
thingy.erase(thingy.begin()+0); //I guess when you delete, it doesn't delete the pointer in the vector!!!!!
Why i am so upset?
My engine IS LOADED WITH VECTORS!!!!!! SPECIFICALLY VECTOR<OBJECT*>THINGY's

Ahh, i feel better now :mrgreen:

Re: Questions about loading maps and check out my new project!

Posted: Fri Apr 02, 2010 2:45 am
by RyanPridgeon
Yeah that's the same with all pointers. Don't forget a pointer is just a pointer, the memory it points to is allocated seperately.

Also wow, you don't waste any time. Nice videos keep it up :D

Re: Questions about loading maps and check out my new project!

Posted: Fri Apr 02, 2010 11:00 am
by lotios611
I'm having trouble running your engine on my computer. It says "Debug Error!" It seems that Allegro can't set the graphics driver.

Re: Questions about loading maps and check out my new project!

Posted: Fri Apr 02, 2010 12:17 pm
by mv2112
lotios611 wrote:I'm having trouble running your engine on my computer. It says "Debug Error!" It seems that Allegro can't set the graphics driver.
:shock:
What's your screen resolution, i'v noticed that if the screen res of your computer is the same as the engine, it crashes cuz it tries to make a windows the same size as the screen. Plus, i haven't upoaded the new engine yet.

Engine res is 1024x768.
To make it smaller, edit the engine.mv file and change 1024 to whatever and 768 to whatever, same with the map editor.

Re: Questions about loading maps and check out my new project!

Posted: Sat Apr 03, 2010 12:37 am
by mv2112
I just thought i would share another FAIL of mine while deving. :mrgreen:
Ok, so i found a bug in my inventory system. I made a heart that adds health when you use it but you cant use it if you have full heath. When ever i would use it, i would get a memory access error, so i just spent about 5 hours looking through all object pointer to see if i was forgetting to delete one(cuz their in vectors). As it turns out, the reason i was getting the error was this:

Code: Select all


int AddHealth(int h)
{
health+=h; //WRONG!!!
}

I was adding an integer to a POINTER!!!!!!

Code: Select all

*health+=h;
OMFG
:nono:

Re: Questions about loading maps and check out my new project!

Posted: Sat Apr 03, 2010 1:39 am
by eatcomics
Don't you just hate when you do stuff like that?

Re: Questions about loading maps and check out my new project!

Posted: Sat Apr 03, 2010 8:23 am
by K-Bal
Why is health a pointer? :)

Re: Questions about loading maps and check out my new project!

Posted: Sat Apr 03, 2010 8:49 am
by lotios611
mv2112 wrote:
lotios611 wrote:I'm having trouble running your engine on my computer. It says "Debug Error!" It seems that Allegro can't set the graphics driver.
:shock:
What's your screen resolution, i'v noticed that if the screen res of your computer is the same as the engine, it crashes cuz it tries to make a windows the same size as the screen. Plus, i haven't upoaded the new engine yet.

Engine res is 1024x768.
To make it smaller, edit the engine.mv file and change 1024 to whatever and 768 to whatever, same with the map editor.
That was the problem. You might want to put that in the README. The only problem is that it's impossible to see the whole map when you change the resolution. That'll go away once you add tile scrolling (you are going to add that, aren't you?).

Re: Questions about loading maps and check out my new project!

Posted: Sat Apr 03, 2010 5:40 pm
by mv2112
K-Bal wrote:Why is health a pointer? :)
Because of my crappy OO design, to render the health bar, the map has a pointer to it.
lotios611 wrote:
mv2112 wrote:
lotios611 wrote:I'm having trouble running your engine on my computer. It says "Debug Error!" It seems that Allegro can't set the graphics driver.
:shock:
What's your screen resolution, i'v noticed that if the screen res of your computer is the same as the engine, it crashes cuz it tries to make a windows the same size as the screen. Plus, i haven't upoaded the new engine yet.

Engine res is 1024x768.
To make it smaller, edit the engine.mv file and change 1024 to whatever and 768 to whatever, same with the map editor.
That was the problem. You might want to put that in the README. The only problem is that it's impossible to see the whole map when you change the resolution. That'll go away once you add tile scrolling (you are going to add that, aren't you?).
Eventualy :mrgreen:

Im probably going to redesign the item system first because it is HORRIBLE, i randomly get vector subscript out of ranges!
(Maybe even re-structure the entire engine)
My OO design is total garbage.

Does anyone have any tips on good OO design practices?

Re: Questions about loading maps and check out my new project!

Posted: Sat Apr 03, 2010 6:09 pm
by GroundUpEngine
mv2112 wrote:Does anyone have any tips on good OO design practices?
Have a skim through this thread, it may help -> http://thechaosrift.com/viewtopic.php?f ... 999#p53934


Also could you describe your Engine structure? So we can see what might need improvement e.g.

Code: Select all

main.cpp // uses instance of engine class to power app/game

class Engine; // handles player & tiles

class Entity; // basic base for renderable's e.g. int x, int y, Init(string filename), Update(), Draw()
class Player : public Entity; // player class
class Tile : public Entity; // tile class
..etc

Re: Questions about loading maps and check out my new project!

Posted: Sat Apr 03, 2010 9:45 pm
by mv2112
GroundUpEngine wrote:
mv2112 wrote:Does anyone have any tips on good OO design practices?
Have a skim through this thread, it may help -> http://thechaosrift.com/viewtopic.php?f ... 999#p53934


Also could you describe your Engine structure? So we can see what might need improvement e.g.

Code: Select all

main.cpp // uses instance of engine class to power app/game

class Engine; // handles player & tiles

class Entity; // basic base for renderable's e.g. int x, int y, Init(string filename), Update(), Draw()
class Player : public Entity; // player class
class Tile : public Entity; // tile class
..etc
ugh, as im looking through the source code, my engine really has no organized structure, lol, here are the classes:

mvEngine: handles inistializaiton and final rendering(contains buffer)
map: map objects that handles loading the map and blitting to buffer
Sprite: started as a sprite class(hence the name) but ended up being a player class
ObjectController: handles all objects in the game
object: handles the properties of objects
heart:public object: different object
orb:public object: different object
//heart and orb are just test objects
inventory: player's inventory system

I think thats it.

One mistake i made was i had every object contain a pointer to the mvEngine rather than mvEngine contain all instances of classes.
I defiantly am going to restructure the engine and use std::vectors sparingly now.

Re: Questions about loading maps and check out my new project!

Posted: Sun Apr 04, 2010 12:41 pm
by GroundUpEngine
Cool structure is important, well sounds like you got it figured out ;)