|
|
View previous topic - View next topic |
Author |
Message |
BigManJones Scholar
Joined: 22 Mar 2003 Posts: 196
|
Posted: Sat Mar 22, 2003 6:09 pm Post subject: How to do BaldursGate/Geneforge gameplay |
[quote] |
|
Hi all, I'm new here although i've been around for awhile under different names. I know this forum mainly concentrates on console style rpgs and thats what Mandrake focuses on too. But I'm curious if anyone else has done programming on a 'crpg' type interface like the interface in Geneforge (Great Game!). I've been working on one and I've reached the point were I'm really seeing the complexity of these things.
In alot of ways the gameplay seem alot like a typical rts. You scroll around the map with your mouse, select units and direct them to perform actions. The main difference is the actions you direct your character to do is alot more complex than anything you have units do in a rts. Your characters can pick stuff up, drop stuff, open doors/chests, go thru doors to new areas, talk to NPC's, attack bad guys with magic/swords/distance weapons, cast spells that interact with the environment/npcs/enemies.
A specific example would be selecting a character then clicking on an object (say a sword) you want the char to pick up. The way I want to do it is have the character walk over to the object then present a dialog with the object/objects in that spot for the player to choose from.
I know i haven't asked any questions here but has anyone done this type of thing or am I in the totally wrong place?
|
|
Back to top |
|
|
Desert Gunstar Lowly Slime
Joined: 10 Jun 2002 Posts: 3 Location: Wild Wild West
|
Posted: Sat Mar 22, 2003 9:58 pm Post subject: |
[quote] |
|
This place is more focused on japanese/console style RPGs more than anything else. I don't think you would find much help here, but we'll see...
Making an engine for this type of game is very complicated. You have heard of BioWare's Infinity engine, haven't you? It is used in Baldur's Gate 1 and 2, and the Icewind Dale games. As you can see, you would have to perfect the engine, as it is very complicated for it to get the desired results. And have you heard of the Might and Magic series? They recycled number 4's engine for three consecutive games, I think. I suggest you study how these engines work (maybe the Infinity engine, your ideas seem to lean toward it). I have never attempted such a thing, but I have thought of it. It is possible, but it involves a lot...
|
|
Back to top |
|
|
Rainer Deyke Demon Hunter
Joined: 05 Jun 2002 Posts: 672
|
Posted: Sat Mar 22, 2003 10:36 pm Post subject: |
[quote] |
|
While I haven't written a game like that, there's no reason why I couldn't (except for the vast amounts of animation needed). There's nothing particularily complicated about an engine like that. And my current rpg project is not really console-style.
|
|
Back to top |
|
|
Nephilim Mage
Joined: 20 Jun 2002 Posts: 414
|
Posted: Sun Mar 23, 2003 5:50 am Post subject: |
[quote] |
|
I don't know what your skill level is at programming, so I'll make some suggestions. Apologies if these are "well, DUH!" kinds of answers.
The main thing I would say about what you are describing is that if you want to model things like that, be sure you are programming using an "Object Oriented Programming" approach. If this term is new to you, do a search on the web and look into it. It is a programming methodology which excels at solving problems like the one you described. This is especially true if you want complicated environments and objects that can work in multiple contexts.
Another thing I would do is to break up the tasks your engine needs to do into mini-tasks that can be called by many larger meta-tasks. In your example, you probably wouldn't want to code it so that whenever someone wants to pick something up, the code moves them to the thing and then has him pick it up. Instead, you will want a generic "move person from point A to point B" task, a "find the path between point A and point C" task, and a "pick something up" task. Then, when the player issues the command to pick up the sword, a series of sub-tasks is generated: "Find the path to the object", "Move along the path", and "Pick up the thing". Once you have the support tasks built, building your game becomes a matter of composing the simpler tasks together to form more complicated ones (often, this is done with a scripting engine rather than directly with code).
By the way, I seem to recall that Jeff Vogel (the guy who mane Geneforge) has written a few articles on programming games. You might want to look on the Spiderweb site or do some web searches to see if you can find them. Those may have some details specific to programming games like Geneforge.
Hope this helps.
|
|
Back to top |
|
|
DrunkenCoder Demon Hunter
Joined: 29 May 2002 Posts: 559
|
Posted: Sun Mar 23, 2003 9:24 am Post subject: |
[quote] |
|
although the main focus of most people here seems to be console RPGs games like BG aren't that much diffrent, the main thing that really differs is that instead of directly controlling the character with arrowkeys or gamepad and having action keys you use the mouse.
It would be quite possible to take a FF clone and just add mouse scrolling and controlling to it and have it play quite much like BG if you added some semi smart pathfinding that is (not that BG chars are to bright in that department though...)
Anyways, on the programming side of things I really can't say that I think the differance is that big, you can still employ any techique used by console style programmers, the thing I think differs the most is actually graphics and presentation. But those areas are really not that coupled with the programming side of things.
just my .02cents.. _________________ If there's life after death there is no death, if there's no death we never live. | ENTP
|
|
Back to top |
|
|
BigManJones Scholar
Joined: 22 Mar 2003 Posts: 196
|
Posted: Mon Mar 24, 2003 12:05 am Post subject: |
[quote] |
|
I haven't seen anything were Jeff Vogel talks about the implementation of his games, I emailed him one time and asked what libs he used, he answered my email, but wasn't especially chatty or forthcoming.
Quote: | It would be quite possible to take a FF clone and just add mouse scrolling and controlling to it and have it play quite much like BG if you added some semi smart pathfinding that is (not that BG chars are to bright in that department though...) |
A graphical UI is quiet a bit more complicated than that. Using the a OOP approach, how does the character know where the object is so it can walk to it? In an infinity engine type game your going to have multiple members in your party, so which character gets the info? Once the character reaches the spot, how does it know it is supposed to display the 'pick-up' dialog? A state variable? Not to mention the whole thing needs to be exposed for scripting.
I'm thinking now about some kind of event listener system such that objects will notify only the selected characters of a 'left mouse click event' which could indicate 1. examine me, 2. walk to me, 3. open me 4. attack me etc... This means each object would have to mainain a list of characters and possibly other objects as well.
Thanks for the input. I'm all ears here.
|
|
Back to top |
|
|
Nephilim Mage
Joined: 20 Jun 2002 Posts: 414
|
Posted: Mon Mar 24, 2003 4:46 am Post subject: |
[quote] |
|
BigManJones wrote: | A graphical UI is quiet a bit more complicated than that. Using the a OOP approach, how does the character know where the object is so it can walk to it? In an infinity engine type game your going to have multiple members in your party, so which character gets the info? Once the character reaches the spot, how does it know it is supposed to display the 'pick-up' dialog? A state variable? Not to mention the whole thing needs to be exposed for scripting.
I'm thinking now about some kind of event listener system such that objects will notify only the selected characters of a 'left mouse click event' which could indicate 1. examine me, 2. walk to me, 3. open me 4. attack me etc... This means each object would have to mainain a list of characters and possibly other objects as well.
Thanks for the input. I'm all ears here. |
Well, clearly you wouldn't want every bar stool, sword on a table, and patch of grass to maintain a list of characters on the off chance the player might want to interact with it. Instead, you would have "manager" objects that handle managing large classes of objects, rather than have every object aware of every other object. The key is to decouple the objects from each other by creating intermediary objects that know how to act as a liaison between them.
Your "click on the map" interface, for instance, might be the intermediary between the sword and the character who picks it up. When the user clicks on the map somewhere, it queries the map object to see what was clicked on, which returns a reference to the sword. The interface manager then sends a message to the sword saying "What kind of object are you?" The sword responds "I'm a pick-up-able object." The map interface knows that characters have to be adjacent to objects to pick them up, so it talks to the pathfinder manager to find a path between the currently active character's location and the sword's location. It then passes instructions to the animation engine: "move this character along this path, and notify me when he gets there". When the character reaches the sword, the map interface tells the character object "you now have the sword" and the sword "you are no longer on the map".
Similarly, suppose the character clicks on a monster on the map. Again, thet map interface sends a message to the monster, "Hey what kind of object are you?" It responds, "I'm a hostile monster." The map interface knows what to do with those, too: hand the pair off to the combat manager (who, in turn, will be communicating with the pathfinder to get them close enough to start killing each other, and with the two combatants to get their relevant statistics).
Notice that the sword and the monster never really interacts with the character objects, until they have valid reason to (namely, when the sword is in possession by the particular character or when the two critters are engaged in combat). Also notice that the map interface doesn't care about what any particular object is or does - it just acts as an intermediary with a few simple rules.
Hopefully, you can see how a scripting engine can fall right out of this system. Since all of the logic is simply messages being passed back and forth between objects, you can replicate code-level logic with script-level logic, making your game engine far more flexible. (Indeed, the behavior described above is often implemented at the scripting level, rather than at the code level, hooking into even lower-level objects, such as map, sprite, and dialog renderers.)
Hope this helps.
Last edited by Nephilim on Tue Mar 25, 2003 5:47 am; edited 1 time in total
|
|
Back to top |
|
|
Jihgfed Pumpkinhead Stephen Hawking
Joined: 21 Jan 2003 Posts: 259 Location: Toronto, Canada
|
Posted: Mon Mar 24, 2003 8:13 am Post subject: Fancy Frankenengine |
[quote] |
|
If it's any help to you, there's a fairly popular open-source RTS engine at <http://freecraft.sourceforge.net>. I'm sure it's not exactly what you want, but it may serve as a foundation, or at any rate a large part of a frankenengine. I haven't really looked at it myself, so I can't guarantee anything, and am sorry if it's useless.
Aside from that, Nephilim's system looks good. If you're having difficulty at the conceptual level, and you're not using an object-oriented programming methodology, I highly suggest you switch. It really does seem very well suited to video-games.
Sorry I can't be more help, but I'm still trying to get my console-style engine working properly, without worrying about fancying it up.
|
|
Back to top |
|
|
Guest
|
Posted: Mon Mar 24, 2003 8:47 am Post subject: |
[quote] |
|
Well, most of the parts needed already are or should be in any FF style rpg.
Think about it like this, in FF when you aproach a chest, boss, NPC or any other thingmabob and press the activate key you need to determine what kind of object it is to know what the heck todo.
Basicly movin this query to the point where you click on an item really is a no brainer, thats your first part.
To know where an item is you only need to query the map, heck you've made a map editor right? how did you know where to place the tiles? same procedure but in reverse here.
So, only pathfinding left to have something that acts quite much like a point and click rpg like BG, and really you should have that in your engine anyways to make handling NPCs easier... I can't imagine that people really script whole paths for NPCs, thats grunt work let the computer do it.
|
|
Back to top |
|
|
DrunkenCoder Demon Hunter
Joined: 29 May 2002 Posts: 559
|
Posted: Mon Mar 24, 2003 8:48 am Post subject: |
[quote] |
|
darn... last reply was mine..
what the heck is wrong with the "remember me" option?
this is the only board where it doesnt work for me, a bit irritating. _________________ If there's life after death there is no death, if there's no death we never live. | ENTP
|
|
Back to top |
|
|
BigManJones Scholar
Joined: 22 Mar 2003 Posts: 196
|
Posted: Tue Mar 25, 2003 3:48 am Post subject: |
[quote] |
|
I looked over the freecraft source and all I can say is 'WOW' what an example of c programming that thing is. It has tons of globals which makes it hard to follow and it seems to use 'slots' like qt or gnome (can't remember which gui uses 'slots') for the ui. It may use c to implement some oop but I'm not a sophisticated enough c programmer to be able to 'see' it :P
Nephilim - Hmmmm... much to think on here. I've used managers before but not like that.....
Quote: | So, only pathfinding left to have something that acts quite much like a point and click rpg like BG, |
Thats what I thought too, but when I got to the point of adding objects and doorways and such is when I found out the real complexity!
|
|
Back to top |
|
|
BigManJones Scholar
Joined: 22 Mar 2003 Posts: 196
|
Posted: Wed Apr 16, 2003 12:03 am Post subject: |
[quote] |
|
There's a new tute on Flipcode that I thought I'd post here on the off chance that you all might not have seen it:
http://www.flipcode.com/articles/article_manageunits.shtml
Its about unit management in an rts but it directly relates to my game play connundrum. In the article the auther talks about giving each unit an 'event queue' - gave me an instant of 'Aaaa Ha! I can do queues!'
|
|
Back to top |
|
|
white_door Icemonkey
Joined: 30 May 2002 Posts: 243 Location: New Zealand
|
Posted: Thu Apr 17, 2003 3:03 am Post subject: |
[quote] |
|
BG games are different to console rpgs only so far as the interface with the whole mouse issue and the fact that the combat tends to be RTS, but not always. In fact several console rpgs do use pathfinding like the strategy combat ones. Pathfinding can be really helpful for making interesting AI.
just like most console RPGs, BG uses a completely static pre-rendered background. With the few areas of importance marked out with polygon shapes. They don't bother managing objects that are part of the scenery so tables.. chairs etc... aren't messed with. They only worry about npcs and objects dropped by npcs or creatures. The shadows are marked out with polygon areas the forground parts of objecs also... and the doors and chests.. And of course the areas that you can or can't walk on.
That's why its so fast ... there isn't the overdraw that comes from making a scene from several layers of tiles and objects. Of course it does mean it takes up massive amounts of HD space, and makes for farely slow load times ;)
|
|
Back to top |
|
|
|
Page 1 of 1 |
All times are GMT
|
|
|
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
|
|