Re: trying to make this multiplayer

You will want to use the network object. If you want the game to support an arbitrary number of players, or allow people to connect to anyone who happens to be online, you'll need a server. If it's more of a 1-4 player game, you could get away with letting players connect to each other privately, without need for a server (similar to how Top Speed 3 handles multiplayer). The end result is much the same, except that processing handled by the server is handled by the clients (or one "host" client, since that model tends to reduce state conflicts).
The network object is a little cumbersome to remember, so I recommend keeping the bgt manual on hand for reference. It's not that complicated, but there are a few things to be aware of. For example, BGT is not multithreaded, so any substantial pauses in the updating of the network object will result in a disconnect. That means you cannot use multiplayer with the alert, input_box, or question functions, and if you use a dynamic_menu, you'll need to use the callback feature to keep the connection active.
But the actual communication between clients is handled by messages, sent through a network_event object. So, all you need to do is send messages telling the peers when a change has occurred, and do ordinary string checks to tell what the change is.

This is not the most effective example, but I like to separate input into two layers: the outer most layer poles for keyboard, mouse, joystick, or network events. The event handlers convert the key, button, movement, or network message into a constant, which is sent to the inner layer. The inner layer then determines what action corresponds to the event constant, and invokes the appropriate methods\functions. This is not enough for a game where precise timing is essential, and it is not enough to handle cases where the players get out of sync, but it makes input more moduler, which makes adding extra input methods much easier.

_______________________________________________
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : rpgtank via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Blademan via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : rpgtank via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : rpgtank via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector

Reply via email to