Results 1 to 8 of 8

Thread: Need ideas for how to do something.

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Sep 2002
    Posts
    26

    Question Need ideas for how to do something.

    I am making an online role playing game, like everquest or whatever.

    I have come across a problem in that I am not sure how to make the npc's (non player characters.

    My problem is I need to have it so the npc's are similar to other players in that move and opperate on all players' computer's the same. So lets on player 1's computer, an npc is walking around at a some coordinate in a level, on player2's computer, that npc is shown walking around on his computer the same as on all other computers. So basically what I need to do is make it seem as though the npc's are real players themselves, acting the same for all players, and not unique to each player.

    One idea I had was to make it so all the npc's run on game host's computer, and then their information(coordinates or whatever) is sent to everyother player, however I figured this could really lag bad if I had like thousand's of npc's information being sent repetitively.

    Any Ideas?

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Why are there thousands of NPCs? Do you mean enemies?

    In current online-RPGs everything the NPCs do is calculated on the server(s). Doing otherwise would be insecure.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974
    You shouldn't send information about all NPC's anyway - you only need to send relevant information to each computer. You should know what each player can see, so only let them know what is visible in that area.

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Sep 2002
    Posts
    26
    Originally posted by CornedBee
    Why are there thousands of NPCs? Do you mean enemies?

    In current online-RPGs everything the NPCs do is calculated on the server(s). Doing otherwise would be insecure.
    My game is more like diablo though where you would just host a game, and people would join, not a mmorp.

    But i just reliezed that i could just make it so it only sends the npc information if that npc is in your screen.

    But the problem remains with on whose computer are the Npc's actions decided on?

    And what if the computer whose deciding their actions leaves the game?

    I am in over my head with this.


    I have another question too, if anyone here uses dx7 do they know a way of doing alpha blending effects, using dx7?

  5. #5
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Look at Diablo 1: it constantly was hacked.

    Diablo2 on the other hand was purely server based.



    Anyway, in case the host leaves some other computer must take over. This should be determined beforehand so there is only little delay.
    When the host leaves the vice host should get all relevant data from him. Or something like that, this particular thing would mean that if the host crashes the game goes boom.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  6. #6
    Addicted Member
    Join Date
    Aug 2002
    Location
    Baltimore, MD
    Posts
    230
    Originally posted by Kadven
    But the problem remains with on whose computer are the Npc's actions decided on?
    Whoever is acting as the host or server

    Originally posted by Kadven
    And what if the computer whose deciding their actions leaves the game?
    You send a message to another player informing him he is now the server. If you use DirectPlay you can set it up so this happens automatically.

    Originally posted by Kadven
    I am in over my head with this.
    I figured that.


    Originally posted by Kadven
    I have another question too, if anyone here uses dx7 do they know a way of doing alpha blending effects, using dx7?
    Check Lucky's site - www.rookscape.com/vbgaming/ or here - www.directx4vb.com

  7. #7
    Ex-Super Mod'rater Electroman's Avatar
    Join Date
    Sep 2000
    Location
    Newcastle, England
    Posts
    4,349
    As far as the Alpha blending goes look into using Direct3D Sprites, even if its 2D you can have Sprites that use 4 vertices to appear on the scren as normal sprites but have features of Direct3D. Theres something about it on the Lucky's site that Machaira mentioned. Look for the hybrid engine.
    When your thread has been resolved please edit the original post in the thread ()
    and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.

    When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

  8. #8
    Fanatic Member alkatran's Avatar
    Join Date
    Apr 2002
    Location
    Canada
    Posts
    860
    Technicly, if there is no random function involved, and all the players have the same data, and movement code for NPCs they should always be in the same spot anyways. At leas that's how I understand they did the StarCraft unit pathing...

    Although if someone had a very slow computer.. you would have to adjust.
    Don't pay attention to this signature, it's contradictory.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width