Game Development Community

GuiMapVote

by Jonathan Wagner · in Torque Game Engine · 10/23/2004 (2:20 pm) · 13 replies

I have been playing around with torque for a little while now. I want to include a mapvote ability in a game. Has anyone done this before, or can point me in a direction of how to do it? I have simple gui's down ok. But adding messaging back to the server, waiting a period of time, tallying votes from players, then making all players move to a new map is a little past me at the moment.

#1
10/23/2004 (2:40 pm)
It can be done, I could do it, I could even describe it to you, but it will not be as easy as you would hope. Based on the skill level you claim, I would say it's a little out of your reach without some serious help.

You would need...

1. A way for a player to start a vote for the map they want and notify the server.
2. Once a vote is started, you need to disable starting a vote till after the current vote is done.
3. Everyone needs a way to cast their vote and only one vote.
4. Server needs to accept votes for a period of time and then stop accepting so it can count.
5. After votes are counted the server needs to reset everyones votes and then carry out the results of the tally be it pass or fail.
6. If passed, then the server would need to initiate the proper steps to change the map to the requested map and then re-enable voting after it's loaded.
7. If failed then server needs to cleanup as if it never happened and then re-enable voting.
8. No player should be able to initiate a vote more than once every 2-5 minutes to save you from annoying slobs that would vote spam.
#2
10/23/2004 (5:09 pm)
I don't want to be misunderstood, I have programmed in c++ for a number of years, and other languages as well. I know what steps are needed to do the map vote. The problem is I don't know what the equivalent methods and variables are in torque to get the job done. The documentation from what I have read so far hasn't proven much help to me. I have always learned best by looking at examples done by others, modifying things, extending code, then writing my own afterwards. I am sure I am not alone in this. Seeing the function calls required for a map vote to work would really help in accelerating my knowledge of torque and making a worthwhile game. That being said, anyonce care to make a resource of a map vote? I bet I'm not the only one who could benefit from looking at one.
#3
10/24/2004 (2:21 am)
Quote:I have always learned best by looking at examples done by others, modifying things, extending code, then writing my own afterwards.

LOL, exactly the way I learned and still learn. You are definately not alone.

I guess I did misunderstand you at first, your profile didn't even mention programming so I assumed you had little experience in programming vs. little experience with Torque.

I can tell you right off that most of the code will have to be written from scratch, and the rest will be standard cmdToServer and cmdToClient and borrowing a little code from the mission start GUI. Shouldn't be that difficult I suppose since I know the engine pretty well. I'll see if I can get something working before the football games tonight, but no promises on the deadline, lol.
#4
10/25/2004 (9:03 am)
Quote:your profile didn't even mention programming
I didn't even think of that. My brother (Jonathan Wagner) bought and registered torque, but doesn't develop in it. I (Keith Wagner) am the actual coder of our little gaming group. Because he has access to forums I do not, I sometimes use his username.

Quote: I'll see if I can get something working before the football games tonight, but no promises on the deadline, lol.

On behalf of others that could benefit from this, I thank you. I am of course in no rush as I have plenty of other areas to work on the game before it even comes close to being ready for a release. Can't wait to see it, though :)
#5
10/25/2004 (9:44 am)
There really isn't a reason to do this in C++, as you could easily do this in script. Utilizing the CmdToServer and CmdToClient function calls. Have a player initiate the vote with a call to a specific function on the server. Then have the server send a message to each client in the ClientGroup to open a popup for voting (or a simple message saying "vote now")

Then, as each client chimes in, set a flag for them or tally the votes. Once you've passed 50%, the vote is as good as passed anyways so you can execute without waiting for everyone.

It would be a simple matter that could be done in about 30 minutes to an hour...

- Brett
#6
10/25/2004 (11:30 am)
Jon and Brett


While it's taking just a little longer, I think you'll see it's worth the wait. I've got a completely script based voting system going now with full documentation and a little wisdom and teaching as well.


And Brett, it's never that simple, lol. You have to consider the entire design of what he asked for. I'm hoping to have this finished tonight.
#7
10/26/2004 (2:23 pm)
Ok, it's done. The resource is HERE but it's not yet been approved. In the meantime I've uploaded the file so you can get at it now. But the cost is you have to rate the resource when it's approved. Don't kiss butt, a fair rating based on your opinion will do, lol.

Get the files here.... GTC Voting System
#8
10/27/2004 (3:40 pm)
Great resource. Simple to implement, easy to follow comments, and a lot to learn from (if you're like me). Thanks!
#9
10/28/2004 (12:28 pm)
Thanks, and the resource is now up and valid....

The Resource
#10
10/28/2004 (1:07 pm)
Map votes suck, it takes away from the server hosts "god rights", jmo. Hope you put a "shut it off" feature in there.

I do want to comment about Gonzo though, Aint you the Gonzo that used to jump all on threads rude like and just piss everyone off?

If so i see a vast improvemnt keep up the good work. :)

If im thinking of someone else, ignor this.
#11
10/29/2004 (2:04 am)
Quote:Map votes suck, it takes away from the server hosts "god rights", jmo. Hope you put a "shut it off" feature in there.

Yes, the shut off feature is not to install it.


Quote:Aint you the Gonzo that used to jump all on threads rude like and just piss everyone off?


I'm probably the ONLY Gonzo you know, and yes you are WRONG in your assesment. Unlike you I have better things to do than look for trouble to stir up. Things like writing code for map votes.



Quote:If so i see a vast improvemnt keep up the good work. :)


Phew, for a minute I was afraid I wasn't going to get your permission. Thanks for all your help Ace.
#12
10/29/2004 (4:25 am)
Ok , iwas thhinking of q3, and how someone wanted to change the map every 5minutes.

ops i spoke to soon

didnt mean to rile you
#13
10/29/2004 (5:42 am)
Come on Ace, this is the mods section.. your comment has nothing to do with gamedev.

I for one am glad to see this resource up, go go Gonzo.