My first steps in game programming

Discuss/post fan stuff (images, fictions, games...)

Postby BenoitRen » Sun Apr 26, 2009 6:02 pm

Talking to NPCs is done using the space bar. All it does at the moment is make the NPC look at you, and prevent movement.

Are you sure about Mieu not following Rhys properly? Because all she's doing is moving towards Rhys' old x and y coordinates while facing the same direction he did.

I've noticed those output files, but I don't use them (yet).
Get Xenoblade Chronicles!
User avatar
BenoitRen
Moderator
Moderator
 
Posts: 3122
Joined: Fri Jul 27, 2007 5:19 pm
Location: Belgium

Postby Zucca » Mon Apr 27, 2009 3:31 am

BenoitRen wrote:Are you sure about Mieu not following Rhys properly? Because all she's doing is moving towards Rhys' old x and y coordinates while facing the same direction he did.
Well it just looks like the distance between Mieu and Rhys isn't the same all the time. Which could actually be more realistic (and is). ;)
User avatar
Zucca
Neifirst
Neifirst
 
Posts: 1915
Joined: Sun Sep 23, 2007 7:06 pm
Location: KUUSANKOSKI, Finland

Postby Missagh » Mon Apr 27, 2009 1:08 pm

BenoitRen wrote:Download mieu.zip (Windows).


Gave me an error message on launch. What file(s) am I missing?
-- Missagh Alami, webmaster of Phantasy Star Cave.
User avatar
Missagh
The Administrator
The Administrator
 
Posts: 1185
Joined: Mon Jan 02, 2006 3:16 am
Location: Sweden and UK

Postby BenoitRen » Mon Apr 27, 2009 2:26 pm

All the files you need should be in there. I just checked with Dependency Walker. What did the error message say?
Get Xenoblade Chronicles!
User avatar
BenoitRen
Moderator
Moderator
 
Posts: 3122
Joined: Fri Jul 27, 2007 5:19 pm
Location: Belgium

Postby BenoitRen » Sun May 03, 2009 4:38 pm

I implemented a bitmap font and a text window. Now the NPCs can talk! Use the space bar when facing them.

Want to change what they say? Edit palace.npc! One line in the window is 24 characters long, and I only account for two lines. After that the characters will spill out of the window.

Download game.zip (Windows).

Zucca, I've done some testing a couple days ago using printf to output the distance. You're right; the distance isn't always the same. You don't even need to turn around to have it happen. I'll probably correct it in the future, but for now I'm leaving it like this, as it's non-trivial to fix. It would seem older RPGs had this problem too anyway.
Get Xenoblade Chronicles!
User avatar
BenoitRen
Moderator
Moderator
 
Posts: 3122
Joined: Fri Jul 27, 2007 5:19 pm
Location: Belgium

Postby Zucca » Sun May 03, 2009 5:18 pm

Ok. I'll test this new version with Wine.
And gratz for the 1337th post. ;)
User avatar
Zucca
Neifirst
Neifirst
 
Posts: 1915
Joined: Sun Sep 23, 2007 7:06 pm
Location: KUUSANKOSKI, Finland

Postby Zucca » Sun May 03, 2009 5:48 pm

Tested and works now with Wine. :)

These printed out to terminal:
Code: Select all
$ wine main.exe
fixme:win:EnumDisplayDevicesW ((null),0,0x32f5a8,0x00000000), stub!
fixme:d3d:IWineD3DDeviceImpl_Release (0x144600) Device released with resources still bound, acceptable but unexpected
fixme:d3d:dumpResources Leftover resource 0x149bd0 with type 1,WINED3DRTYPE_SURFACE
I guess those aren't fatal. Only Wine specific warnings. Altough it seemed to use close to 80% of CPU time.
I used Wine version 1.1.12.

EDIT:
Last time I tested your program, I used Windows Vista. I can test this game.zip with Windows XP and Win95 on Qemu too...
EDIT2:
Ok. This is rather funny...
With Vista it "sort of" works (the earlier version)...
With Win95 it doesn't. Same goes with WinXP, but it doesn't even tell eny error. Simply nothing happens, except that it creates the stdout and stderr files...
Shots: 95, XP
User avatar
Zucca
Neifirst
Neifirst
 
Posts: 1915
Joined: Sun Sep 23, 2007 7:06 pm
Location: KUUSANKOSKI, Finland

Postby BenoitRen » Sun May 03, 2009 10:18 pm

As far as I know, SDL doesn't even use Direct3D.

For Windows 95, you're missing the Microsoft Visual C Runtime library that SDL.dll depends on. It can be easily downloaded from Microsoft.
Get Xenoblade Chronicles!
User avatar
BenoitRen
Moderator
Moderator
 
Posts: 3122
Joined: Fri Jul 27, 2007 5:19 pm
Location: Belgium

Postby Zucca » Mon May 04, 2009 3:53 am

Well, I belive that no one really uses Win 95 nowdays. ;)
But the error with Windows XP was rather strange.
User avatar
Zucca
Neifirst
Neifirst
 
Posts: 1915
Joined: Sun Sep 23, 2007 7:06 pm
Location: KUUSANKOSKI, Finland

Postby BenoitRen » Mon May 04, 2009 1:46 pm

Zucca wrote:Well, I belive that no one really uses Win 95 nowdays. ;)

More people than you think. :)
Get Xenoblade Chronicles!
User avatar
BenoitRen
Moderator
Moderator
 
Posts: 3122
Joined: Fri Jul 27, 2007 5:19 pm
Location: Belgium

Postby Zucca » Mon May 04, 2009 5:44 pm

BenoitRen wrote:
Zucca wrote:Well, I belive that no one really uses Win 95 nowdays. ;)

More people than you think. :)
Ooo... I'm not alone? :shock:
User avatar
Zucca
Neifirst
Neifirst
 
Posts: 1915
Joined: Sun Sep 23, 2007 7:06 pm
Location: KUUSANKOSKI, Finland

Postby BenoitRen » Thu Oct 08, 2009 9:45 pm

Lost posts:
Zucca, Mon Jul 20, 2009 4:08 am wrote:*bump*

Any updates?

BenoitRen, Mon Jul 20, 2009 2:55 pm wrote:In mid-May I bought a book on game programming (which uses Allegro instead of SDL), in hopes of refining my understanding and techniques. I finished reading the two first parts (of three) in late June, but aside from introducing me to Mappy, I haven't learned much. I doubt I'll learn more with the so-called "advanced" part, looking at the table of contents.

No more game programming has been done since last time I posted in this thread. I wanted to read the book first, and after that I've been busy with other things. I do want to continue one of these days, though.

Zucca, Mon Jul 20, 2009 6:10 pm wrote:Whoa! That Allegro really fits to 2D game programming!
What's the book you bought?

BenoitRen, Mon Jul 20, 2009 7:10 pm wrote:Game Programming All-in-one, 2nd edition, by Jonathan S. Harbour. It was only €4,95 at the big book sales event I went to.

I remember that Zucca made one more short post that ended up on the third page, but no search engine cache has it.
Get Xenoblade Chronicles!
User avatar
BenoitRen
Moderator
Moderator
 
Posts: 3122
Joined: Fri Jul 27, 2007 5:19 pm
Location: Belgium

Postby BenoitRen » Mon May 24, 2010 1:36 pm

I've sort of started working on this. I improved the code for talking to NPCs days ago, and I've just reimplemented Mieu following Rhys, which is now accurate. The only problem is that she keeps animating while Rhys is colliding with something, which makes his animation stop. I'm not sure how to fix this without working around the structure I'm using now, which is as follows:
  • hero and NPCs move
  • collisions are tested and handled
  • follower moves

All the follower knows is if the hero tried to move. It doesn't know a collision has happened. I did it this way because having the follower move with the rest and possibly having to move back later seemed hard to implement. So I just stuck it after the rest, and now I see the consequences...
Get Xenoblade Chronicles!
User avatar
BenoitRen
Moderator
Moderator
 
Posts: 3122
Joined: Fri Jul 27, 2007 5:19 pm
Location: Belgium

Postby Zucca » Mon May 24, 2010 5:19 pm

How about checking the coordinates?
Here's an example in no-particular-programming-language.
Code: Select all
if $LEADER_OLD_POS != $LEADER_CURRENT_POS
then
    move $FOLLOVER $LEADER_OLD_POS
endif
You just have to implement this to other followers too.
I think best way is to use arrays for followers and their positions as key values.

I don't know much but this may be really CPU consuming.
User avatar
Zucca
Neifirst
Neifirst
 
Posts: 1915
Joined: Sun Sep 23, 2007 7:06 pm
Location: KUUSANKOSKI, Finland

Postby BenoitRen » Mon May 24, 2010 5:36 pm

It shouldn't have to check that, as the leader already checks if it moved coordinates, and then adds its old position to a list that the follower manages.

I think I might as well revert to how I originally did things. Which is to check for collision immediately after moving an entity.
Get Xenoblade Chronicles!
User avatar
BenoitRen
Moderator
Moderator
 
Posts: 3122
Joined: Fri Jul 27, 2007 5:19 pm
Location: Belgium

PreviousNext

Return to Fan stuff

Who is online

Users browsing this forum: No registered users and 5 guests

cron