Well there are different strategies you can look into to start (or combine naturally): states, goals, reactive agents…I hate to put it this way, but you simply have some Googling to do if you're starting from ground zero like this. :)
I'm learning Python right now. Been coding a MUD so that I can practice it A LOT more. So what would I want my monsters to do right now? Just a basic fight function (HP, Atk) and the movement function. I have the fight down, but the movement is more difficult or maybe… I just need to try a bit more. :p
I'm doing objective/goal based. At least, that's the plan so far. I've not started writing code, just documenting my plan so I have something to follow. Like you, I'm learning python though so that's why I don't have any code yet. :D
However, I may incorporate some other elements as well depending on how well I actually do with learning python(As in, if I stick with it).
07 Aug, 2010, Chris Bailey wrote in the 6th comment:
Votes: 0
I like the idea of goal oriented npc tasking. If you don't feel like you are ready to implement something like that there are several simple solutions you can try while learning. The most straight forward approach I can think of would be to have an NPC check for a list of exits from their current position and then randomly choose one. That system isn't very open ended or upgrade friendly though (imho).
08 Aug, 2010, David Haley wrote in the 7th comment:
Votes: 0
Simple movement planning is relatively easy, but it'll be rather difficult if you don't have a clear goal in mind. As Runter asked, what exactly do you want these mobs to be doing? Are they wandering around looking for treasure/food? Are they hunting or running from the players? etc.
If this is just a conceptual question related to representing rooms and transferring actors between them then there are many different ways to do this.
No doubt the most straight forward is a two dimensional array of room objects. This is particularly simple because links between rooms are logical and understood by default.
What I want the mobs to do? Like I said, really simple. Just wondering; not really doing anything helpful for themselves other than make it appear to people that the game is ALIVE! Lol.
I really have no clue how to move them room to room. Been trying to find a code-base that I could look off for ideas. Examples always help. >.>
In most MUDs, especially ones that are room based, they don't really have the concept of true movement, but have simple teleporting from room to room. Normally the rooms have some sort of list of what is in them, and the things keep track of what room they are in. In such a system, you simply remove the thing from the room list they were in, put them in the room list of the target room and set their current location to the new room. In a system that has some concept of spatial positioning, you might have the things hold their position as the coordinate in the world or some smaller bounding box (maybe a hybrid coordinate/room system). You could then start updating their position at some time increment with a delta x and y (and z, or even some other coordinate system altogether) depending on the direction of travel (could be a compass direction, or finding a path to something or somewhere). This is just a few ideas, other ways of doing things are possible of course.
What I want the mobs to do? Like I said, really simple. Just wondering; not really doing anything helpful for themselves other than make it appear to people that the game is ALIVE! Lol.
I really have no clue how to move them room to room. Been trying to find a code-base that I could look off for ideas. Examples always help. >.>
I was confused by your question here and on TMC.
Why would the physics of your NPC movement differ from the physics of the player movement?
If there is no reason for a difference, just make the physics do the same thing.
If you're asking how to make the monster decide which way to go, there must be some simple random() like function available in the language you're using, that allows you to pick a random number from a table that associates exits with numbers.
I'm really not understanding your confusion, I'm afraid. Are you basically stuck at square one? A mud-from-scratch might not be the best decision for you if you're a complete beginner.
Why would the physics of your NPC movement differ from the physics of the player movement?
If there is no reason for a difference, just make the physics do the same thing.
If you're asking how to make the monster decide which way to go, there must be some simple random() like function available in the language you're using, that allows you to pick a random number from a table that associates exits with numbers.
I'm really not understanding your confusion, I'm afraid. Are you basically stuck at square one? A mud-from-scratch might not be the best decision for you if you're a complete beginner.
No. Building something that's your own is where everyone should start. Lol.
@Sharmair Thanks for the advice. I'm going to sit down and map some stuff out.
@ Cratylus Sigh… I am a complete n8b at making MUDs. Lol. I think I need to associate things with numbers, like arrays or something? I don't know… I'll start throwing in what you guys have told me. :p
08 Aug, 2010, David Haley wrote in the 13th comment:
Votes: 0
Quote
No. Building something that's your own is where everyone should start. Lol.
I'm not entirely sure if you're serious, because you seem to use "Lol" to terminate serious sentences. But starting from scratch when you have no idea what you're doing is really not the best path to success.
I'm not trying to be negative here, but it seems that you don't even really know what question you're asking. You're talking about moving around to make the world look alive, and your thought of action is to "associate things with numbers". (??)
Perhaps you should work on another codebase to see how things work there, and use that as inspiration?
But starting from scratch when you have no idea what you're doing is really not the best path to success.
q.v. DIKU
I find it interesting, and pretty satisfying, that most searches for DIKU now place some DikuMUD material higher than the institution after which it was named.
08 Aug, 2010, Chris Bailey wrote in the 16th comment:
Votes: 0
GhostInAProgram - What do you have in place as of now? Does your codebase currently have support for specific locations? Have you created items that can be manipulated in game? If so, how do you determine the location of an item if it is dropped in a room? However you go about designing this, you need a way of knowing what players, npcs and items (amongst other things?) are within a certain vicinity. In order to do that you have to keep track of the location of all of these things. Either a locale keeps a record of it's contents, or each game object stores it's own coordinates…something. If that is in place, making the NPC's move is very simple. You just adjust their current location. To make them move randomly, you will randomly select from a list of destinations current'y available to the npc, and adjust it's location accordingly. If you are currently lacking the framework to make this possible, you are going to have problems with a lot more than just moving your npcs around. So give us some details?=)
Bah now I look stupid. >.> One quick question before I start… How the hell does 'lol' make a serious sentence null? Anyways…
I have no clue on how to make coordinates or locals for objects; something I need to learn obviously. When I said 'working with numbers' I was meaning the coordinates . Lol.
As for a basic character… I'm not sure if it's an actual character. Hmmm, lemme explain. >.> You log in and it tests to see if your host name and password are currently saved (in a text file) if not you start a new character. I don't have any 'class' or 'race' selection right now I'm just trying to keep it basic and work my way up so I can understand things more. You know? So what I've been trying to do with my 'host' or the user is put some default attributes on them when they log in (haven't figured out a way yet to manipulate them or save them correctly). The host can move around the 4 rooms (Haven't felt like creating any more because I'm still testing things out inside that small space to get to them faster), but everything that is assigned to these rooms are just 'lifeless'.
So I don't even feel like I have an actual user yet. It's more or less entering in buttons. The game isn't 'alive'. Lol.
My Yahoo! is ghostinaprogram - if you're cool enough to help me through IM's.
Again thanks to the replies!
-Ghost
08 Aug, 2010, David Haley wrote in the 18th comment:
Votes: 0
Quote
One quick question before I start… How the hell does 'lol' make a serious sentence null? Anyways…
"lol" doesn't make a sentence null, it makes it look like you're just joking around, which makes it a little hard to figure out if you want to be taken seriously…
Quote
So I don't even feel like I have an actual user yet. It's more or less entering in buttons. The game isn't 'alive'. Lol.
When you can't put the game down, when you feel what the character feels, when you feel like you're in the environment your character is, etc. My game seems stiff and rugged - I want it flexible and smooth. Ha ha.
08 Aug, 2010, Chris Bailey wrote in the 20th comment:
Votes: 0
Ok, so if you have four "rooms" and you are able to "be" in those rooms, you must be storing the current location of your "character", yes? Something is keeping track of the characters current location otherwise you wouldn't be able to "be" anywhere. This is the exact same thing you need to do with an npc. Then just update it's location to make it move! =) Am I missing something?
Wondering how I would make a monster walk from room to room or maybe just initiate some basic AI?
-Ghost