Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
Base-style scoring?

 
Post new topic   Reply to topic Printable version
 View previous topic  gamerecord feature - Require help Post :: Post timers and per arena data with python  View next topic  
Author Message
typobox43
Newbie


Joined: Sep 23 2004
Posts: 3
Offline

PostPosted: Thu Sep 23, 2004 2:35 pm    Post subject: Base-style scoring? Reply to topic Reply with quote

I'm trying to set up my ASSS server to score similarly to the Trench Wars zone (periodic reward for every player on the flag-holding team, and a score bonus for kills while your team holds the flag.) I've looked through the User Guide and searched the posts on this forum, tried a few suggestions, and it doesn't seem to work. Can anyone give me any pointers as to what configuration options I would need to do such a thing?
Back to top
View users profile Send private message Add User to Ignore List
Guest



Offline

PostPosted: Thu Sep 23, 2004 4:18 pm    Post subject: Reply to topic Reply with quote

so you want a turf flagging game.... use turf?
Back to top
Guest



Offline

PostPosted: Thu Sep 23, 2004 4:40 pm    Post subject: Reply to topic Reply with quote

Yeah, but the documentation's a bit thin (or non-existent) for the turf options, and what I've seen around the forums doesn't seem to work much. Either that, or I have no clue what I'm doing. Always a possibility. icon_smile.gif
Back to top
typobox43
Newbie


Joined: Sep 23 2004
Posts: 3
Offline

PostPosted: Thu Sep 23, 2004 4:41 pm    Post subject: Reply to topic Reply with quote

Gah, that was me. I forgot to log in. :/
Back to top
View users profile Send private message Add User to Ignore List
Grelminar
Creator of Asss


Joined: Feb 26 2003
Posts: 378
Offline

PostPosted: Fri Sep 24, 2004 2:57 am    Post subject: Reply to topic Reply with quote

Let's try the periodic part first: this should be possible with the standard modules. periodic and points_periodic should be loaded. You'll need to set Periodic:RewardDelay to something nonzero, and Periodic:RewardPoints to the number of points per flag to award. You'll also need to add points_periodic to the Modules:AttachModules line for the relevent arena(s).

I don't believe there's currently a way to award points per kill for team-owned flags. It's pretty easy to add, and I'll try to get to it soon. It's certainly possible if you write your own kill points module, which you might want to do anyway to further customize your scoring.
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website
Grelminar
Creator of Asss


Joined: Feb 26 2003
Posts: 378
Offline

PostPosted: Fri Sep 24, 2004 3:24 am    Post subject: Reply to topic Reply with quote

Btw, here's how you'd write such a module in python. Note that this won't work in 1.3.2 due to a bug/missing feature that I just fixed, but it should work in the future:

Code: Show/Hide
from asss import *

cfg = get_interface(I_CONFIG)
flags = get_interface(I_FLAGS)

def mykill(arena, killer, killed, bty, flags, pts, green):
    teamflags = flags.GetFreqFlags(arena, killer.freq)
    ppf = cfg.GetInt(arena.cfg, "Kill", "PointsPerTeamFlag", 0)
    pts += teamflags * ppf
    return pts, green

cb1 = reg_callback(CB_KILL, mykill)
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website
typobox43
Newbie


Joined: Sep 23 2004
Posts: 3
Offline

PostPosted: Fri Sep 24, 2004 3:30 am    Post subject: Reply to topic Reply with quote

What bug is this, exactly? Is the issue in the Python interface, or would I not even be able to write a C module to perform this task?

[edit] By the way, I'll try out your config suggestions tomorrow... err... later today. My test group is all sleeping. Slackers. [/edit]
Back to top
View users profile Send private message Add User to Ignore List
Grelminar
Creator of Asss


Joined: Feb 26 2003
Posts: 378
Offline

PostPosted: Fri Sep 24, 2004 3:56 am    Post subject: Reply to topic Reply with quote

Sorry, I should have been more specific: it's in the python interface only. CB_KILL callbacks in C are fine. Details: I had prevented CB_KILL from appearing in python because I thought my stub generator didn't support in/out parameters for callbacks. But on closer inspection, it does, and I was being too cautious by excluding CB_KILL.
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website
-Smong-
Guest


Offline

PostPosted: Sat Sep 25, 2004 8:37 am    Post subject: Reply to topic Reply with quote

To keep it subgame compatible the actual setting is Kill:KillPointsPerFlag, which also compares the killers bounty with Kill:KillPointsMinimumBounty before adding the flag bonus.

Also don't you need to increment the kill points stat? Otherwise when you re-enter the arena you will have less points.
Back to top
Grelminar
Creator of Asss


Joined: Feb 26 2003
Posts: 378
Offline

PostPosted: Sat Sep 25, 2004 4:42 pm    Post subject: Reply to topic Reply with quote

Ok, I made two changes. I'd like to know if these are acceptable.

First, there are now four settings, FlagMinimumBounty, PointsPerKilledFlag, PointsPerCarriedFlag, and PointsPerTeamFlag, all in the Kill section. FlagMinimumBounty is the minimum bounty you must have for the next three to take effect. PointsPerKilledFlag is the number of points the killer gets for each flag the killed player was carrying. PointsPerCarriedFlag is the number of points the killer gets for each flag he is carrying (including any that just transferred). PointsPerTeamFlag is the number of points the killer gets for each flag his team owns (also including any that just transferred). The setting names are different from subgame because I thought subgame's setting names were too long (why include "Kill" in the setting name when it's in the section name already?) and were misleading (KillPointsMinimumBounty sounds like it applies to all kill points, but it only applies to flag bonuses). If someone really objects, I can change them to match subgame. Note that AFAIK, subgame has no equivalent of PointsPerKilledFlag and PointsPerCarriedFlag.

Second, and this addresses Smong's question, I changed the way the kill callback works. It's no longer the responsability of each callback to call IncrementStat. They should just increment the value at *points, and the game module will handle the stats side of things. This keeps the value computed by the client and the value in the db in sync by making it impossible to change one without changing the other, and makes it slightly easier to write kill callbacks that add points.

So with this change, and the last one, my little snippet should finally work.
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website
-Smong-
Guest


Offline

PostPosted: Tue Sep 28, 2004 4:45 pm    Post subject: Reply to topic Reply with quote

All sounds good to me.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> ASSS Questions All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can 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
You can attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 18 page(s) served in previous 5 minutes.

phpBB Created this page in 0.508570 seconds : 36 queries executed (94.5%): GZIP compression disabled