RPGDXThe center of Indie-RPG gaming
Not logged in. [log in] [register]
 
MSVC++ and Allegro - Trouble With Mandrake's Tut.......
 
Post new topic Reply to topic  
View previous topic - View next topic  
Author Message
DeveloperX
202192397


Joined: 04 May 2003
Posts: 1626
Location: Decatur, IL, USA

PostPosted: Wed May 14, 2003 11:18 pm    Post subject: MSVC++ and Allegro - Trouble With Mandrake's Tut....... [quote]

This topic is direct mainly at Mandrake, since this is HIS tutorial I'm trying to follow.

Though, if anyone else can help, I'd appreciate it.

The tutorial I'm trying to follow is located at
http://www.pixelate.co.za/issues/9/articles/begin/article.html

I've got MSVC6, and Allegro4xx (whatever is the latest version)
I've got it installed properly, and I've linked to the alleg.lib file.
I've made 4 pcxfiles, Tile0.PCX, Tile1.PCX, Tile2.PCX, Char0.PCX
to be the graphics that are talked about in tht tut (renamed for ease of expansion)

I clicked compile.. ok, 0 errors, 0 warnings...
Run mandrakerpg.exe ...
Draws all the tiles all weird colors (cannot figure out why)

I had to HEAVILY MODIFY the code from the tutorial to get it to compile.
Such as the lack of enough parameters for blit(), and missing semicolons.
And fixing the directions to move the sprite the right way.

It doesn't draw the sprite correctly, the colors are messed up,
I cannot move all over the map without the program crashing,
etc..
Anyway, it is all screwed up, I'm uploading the exe, and *pcx files and the map file. for you to see what I mean,

http://developerx.ccps.ish.biz/allegrorpg.zip

Someone please give me a hand.

source is exact as the tutorial, except for the syntax errors that I fixed to get it to compile.
_________________
Principal Software Architect
Rambling Indie Games, LLC

See my professional portfolio
Back to top  
akOOma
Wandering Minstrel


Joined: 20 Jun 2002
Posts: 113
Location: Germany

PostPosted: Thu May 15, 2003 1:12 pm    Post subject: [quote]

You don't refresh the background, do you?
_________________
Keep on codin'
-----------------

-----------------
Just another post to increase my rank...
Back to top  
DeveloperX
202192397


Joined: 04 May 2003
Posts: 1626
Location: Decatur, IL, USA

PostPosted: Thu May 15, 2003 9:38 pm    Post subject: [quote]

nevermind.

Heh, I started my own base project, and I've solved all my
problems, except for loading a mapfile (which Bjorn is helping me with)

Anyway, for anyone else, here is the solution:
IMHO, DONT USE MANDRAKE'S TUTORIAL CODE.
It doesn't compile, it is inefficient, and it is sloppy.
(sorry mandrake, but I couldn't follow your tutorial very well)

Well, Expect a walk-around demo in the next few days..
_________________
Principal Software Architect
Rambling Indie Games, LLC

See my professional portfolio
Back to top  
akOOma
Wandering Minstrel


Joined: 20 Jun 2002
Posts: 113
Location: Germany

PostPosted: Fri May 16, 2003 12:37 pm    Post subject: [quote]

Ok,.., I'm looking forward to play this demo...will you give the source code out with the game or not...I'd be interested in looking at it..
_________________
Keep on codin'
-----------------

-----------------
Just another post to increase my rank...
Back to top  
DeveloperX
202192397


Joined: 04 May 2003
Posts: 1626
Location: Decatur, IL, USA

PostPosted: Sat May 17, 2003 4:14 pm    Post subject: [quote]

akOOma wrote:
Ok,.., I'm looking forward to play this demo...will you give the source code out with the game or not...I'd be interested in looking at it..


well, I built the demo from this source (of course there is no game stuff in it, or any of the allegro stuff added, this is just the shell code that I wrote.)
If you want the actual source to the demo, email me at

ccps@SoftHome.net

I've got a 'funny' little walk-around demo done.. (like I said,)
For anyone that doesn't know what to do:


Extract game2.exe, and the data folder into a folder on your harddrive (KEEP THE FOLDER HIERARCHY)
run game2.exe, and press ENTER when you see the titlescreen,
and press any key to start the demo.

To exit the demo, press ESC on the map, and at the gameover screen.

To 'talk' to objects, press SPACEBAR. (try it all over the place!)

Well, I'll be adding some 'RPG' elements soon (most likely this weekend) like HP, MP, and dangerous terrain tiles (aka, poison grass aka Final Fantasy V)
and hopefully animated tiles, if I can figure them out. :p

anyway, url for walkaround demo:

http://developerx.ccps.ish.biz/tw000.zip

and RPG classes that I've made:

http://developerx.ccps.ish.biz/rpgclass.zip

oh, and tutorials for beginner programmers:

http://developerx.ccps.ish.biz/alltut.zip
_________________
Principal Software Architect
Rambling Indie Games, LLC

See my professional portfolio
Back to top  
akOOma
Wandering Minstrel


Joined: 20 Jun 2002
Posts: 113
Location: Germany

PostPosted: Sun May 18, 2003 6:14 pm    Post subject: [quote]

Nice 'lil demo...but I expected more than that by using Allegro
_________________
Keep on codin'
-----------------

-----------------
Just another post to increase my rank...
Back to top  
DeveloperX
202192397


Joined: 04 May 2003
Posts: 1626
Location: Decatur, IL, USA

PostPosted: Mon May 19, 2003 3:27 am    Post subject: [quote]

akOOma wrote:
Nice 'lil demo...but I expected more than that by using Allegro

I've never used allegro before.
I only spent 3-4 hours total coding that demo.
I'm rewriting the engine currently, to more encapsulate the tiling routines into a class, rather than ten - twenty functions lingering around my sourcecode. :p

I've made a tile class, but I'm having runtime general protection fault errors, when exiting the game now.

This is my tileclass:

Code:

class CTileTyp
{
private:
    BITMAP * TileImage;
    int frame_count;
    bool obstructive;
   
public:

    CTileTyp  ();
    ~CTileTyp ()
    {
   frame_count = 0;
    destroy_bitmap (TileImage);
    }

    void Load (const char * tilefile, PALETTE tpal)
   {
   TileImage = load_bitmap (tilefile, tpal);
   }
    void Draw (BITMAP* drawing_surface, int x, int y)
    {
    blit(TileImage, drawing_surface, 0, 0, x, y, TileImage->w, TileImage->h);
     }
};


do you see any problems here?
_________________
Principal Software Architect
Rambling Indie Games, LLC

See my professional portfolio
Back to top  
Bjorn
Demon Hunter


Joined: 29 May 2002
Posts: 1425
Location: Germany

PostPosted: Mon May 19, 2003 7:58 am    Post subject: [quote]

- Check whether the loading of the tile bitmap is succesfull in the Load method.
- Initialize frame_count to 0 and TileImage to NULL in the constructor.
- Before destroying the bitmap, you might want to check if it even exists.
Back to top  
DrunkenCoder
Demon Hunter


Joined: 29 May 2002
Posts: 559

PostPosted: Mon May 19, 2003 8:17 am    Post subject: [quote]

you should check the return value from load_bitamp also be sure
to not double delete tiles also check so that you don't accidently
refrence them after they've been deleted.

Actually, witout knowing more about the sourinding code it's hard
to diagnose the problem, given that it runs until quit-time
I would try just removing the delete_bitmap call to see if
that fixes things, if that do fix it then you most probably have
a double delete bug or you're trying to refrence a dead object

else well else something else is blowing up =)
_________________
If there's life after death there is no death, if there's no death we never live. | ENTP
Back to top  
mandrake*rpgdx
Guest





PostPosted: Tue May 20, 2003 7:12 pm    Post subject: [quote]

yeah the code in that tutorial sucked...but meh, it was written as a favor, and I had a few people check the code, but I guess they were lazy and lied to me about it working. Either way, though, no reason to be pissy. Blame pixelation for actually putting it up without checking it either.

It sucks, but big whoop.
Back to top  
DeveloperX
202192397


Joined: 04 May 2003
Posts: 1626
Location: Decatur, IL, USA

PostPosted: Wed May 21, 2003 2:37 am    Post subject: [quote]

mandrake*rpgdx wrote:
yeah the code in that tutorial sucked...but meh, it was written as a favor, and I had a few people check the code, but I guess they were lazy and lied to me about it working. Either way, though, no reason to be pissy. Blame pixelation for actually putting it up without checking it either.

It sucks, but big whoop.

Didn't mean to offend you.

Sorry.
_________________
Principal Software Architect
Rambling Indie Games, LLC

See my professional portfolio
Back to top  
mandrake*rpgdx
Guest





PostPosted: Sun Jun 08, 2003 7:58 pm    Post subject: [quote]

naw, no offense taken. I'm glad the first one sucked, i leanred from it's mistakes, and now, hopefully the book i'm working on will actually be good :)
Back to top  
Post new topic Reply to topic Page 1 of 1 All times are GMT
 



Display posts from previous:   
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum