Statistics Lua

Discuss and unveil current Marathon projects.

Post Aug 14th '10, 18:53

Please make this:

A lua script that tracks:

-total health lost
-hit accuracy for all player projectiles
-damage inflicted per minute
User avatar

goran

Post Aug 14th '10, 20:54

G.S.10 wrote:Please make this:

A lua script that tracks:

-total health lost
-hit accuracy for all player projectiles
-damage inflicted per minute


Made. But it was boring and everyone seemed to hate the idea of statistics. Now that I can't play worth a damn anymore I don't want people to see how much I suck, numerically. So deleted. Gone, but not forgotten.
Image Image
User avatar

interion

Post Aug 14th '10, 22:05

Tim wrote:Made. But it was boring and everyone seemed to hate the idea of statistics. Now that I can't play worth a damn anymore I don't want people to see how much I suck, numerically. So deleted. Gone, but not forgotten.

It sounds like you made it wrong. Of course people are going to hate the idea of seeing the statistics. The lua requested should track the statistics, not display them.
User avatar

Wrkncacnter

Post Aug 14th '10, 22:32

Tim wrote:Made. But it was boring and everyone seemed to hate the idea of statistics. Now that I can't play worth a damn anymore I don't want people to see how much I suck, numerically. So deleted. Gone, but not forgotten.


I'm sorry things turned out that way for you. Personally I want to use for solo play and coop. Having an extra set of goals can make things more interesting.
User avatar

goran

Post Aug 15th '10, 00:52

I had considered writing Achievements.lua, speaking of extra sets of goals. It would be pretty easy to cheat, though.

For solo scripts, statistics will be possible in the next release of Aleph One. For net scripts, they still won't be, since net scripts cannot read from or write to files.
User avatar

treellama
Pittsburgh

Post Aug 15th '10, 07:56

Treellama wrote:I had considered writing Achievements.lua, speaking of extra sets of goals. It would be pretty easy to cheat, though.

For solo scripts, statistics will be possible in the next release of Aleph One. For net scripts, they still won't be, since net scripts cannot read from or write to files.


Netscripts can still output text to the log file can't they?
Image Image
User avatar

interion

Post Aug 15th '10, 20:52

After downloading your Infinity textures, it is the least I could do to write this script. How does it work? Are the statistics displayed in the Lua HUD? You realize you can't enable two Lua net scripts at once, right? So you would have to forgo Co-op Lua to use statistics.
User avatar

treellama
Pittsburgh

Post Aug 15th '10, 21:37

Thank you :)

I want them to be displayed in the upper screen, like visual mode has numbers etc displayed.

To illustrate:

Player 1 ............ Accuracy: 80% ............ Health lost 23000 ............ Damage per minute 98756
Player 2 .............Accuracy: 90% ............ Health lost 26020 ............ Damage per minute 101765


Typing .show [player name].........will show that players stats
Typing .hide [player name] .........will hide that players stats
Typing .show all........................will show stats for all players
Typing .hide all.........................will hide stats for all players
Typing .help.............................will show the four above commands

All players will show by default.
Last edited by goran on Aug 15th '10, 21:46, edited 1 time in total.
User avatar

goran

Post Aug 15th '10, 22:02

There can be only 6 overlays at once--so not enough to display all players stats. Also, you can only type in commands in solo, not co-op. Let me think about this.
User avatar

treellama
Pittsburgh

Post Aug 15th '10, 22:19

Is it possible to cycle through and only show four players at one time, then they the next four a little bit later? Or even two at a time so it won't be as big and distracting.
As for typing the commands in co-op, if you don't want to see the stats, don't host with the script.
I am Daemon. I am not an entity, I am in time. My time is now. The word, is Cron.
Why do they suffer needlessly when the Word is inevitable?
User avatar

Daemon
The Super Computer

Post Aug 16th '10, 00:23

Treellama wrote:Also, you can only type in commands in solo, not co-op.


When cryos and I use vml in coop, both of us can save the level. Is the ."save level" command special?
User avatar

goran

Post Aug 16th '10, 01:04

.save level is built into the engine--you can use it without any Lua running.
User avatar

treellama
Pittsburgh

Post Aug 16th '10, 07:58

You could show 1 player's stats at a time and use the mic key to scroll through the players.
Eternal - Xmas I - Xmas II - Xmas III - Victory Dance IV - Winter I: The Venom - KTA III - Phoenix - somewhere in the heavens, waiting: The Syndicate
User avatar

Drictelt

Post Aug 16th '10, 13:00

Or action to highlight the stats menu, and next/prev to switch players; then action again to set. There are lots of ways to do one player at a time, but no way to do more than one, or to accept commands in net games.
User avatar

treellama
Pittsburgh

Post Aug 16th '10, 13:12

You probably wouldn't want to bind the Action key to some Lua. Some maps have doors.
User avatar

RyokoTK
Saint Paul, MN

Post Aug 16th '10, 13:44

Haven't you used Visual Mode.lua? Doors and control panels work fine :)
User avatar

treellama
Pittsburgh

Post Aug 16th '10, 14:04

Is one overlay required per player, or per stats attribute?

I'm cool with just displaying one player at a time as long as there is some conveniant way to scroll through them.

While we're on the topic of keys, have you ever considered to add more keys to aleph one? E.g. Special Lua key 1, Special lua key 2 and so on?
User avatar

goran

Post Aug 16th '10, 14:40

G.S.10 wrote:Is one overlay required per player, or per stats attribute?

Each overlay slot can display an icon and about 10 characters of text. So, one per stats attribute.

I'm cool with just displaying one player at a time as long as there is some conveniant way to scroll through them.
I'll do that.

While we're on the topic of keys, have you ever considered to add more keys to aleph one? E.g. Special Lua key 1, Special lua key 2 and so on?

This was discussed when Lua was first added, a long time ago. Unfortunately, in order for these to work in net games, they would have to be replicated. Currently we use a 32-bit integer for action flags, and we are using every one of those 32 bits. Adding an additional flag would require in the best case an additional byte for each player in the game per tick, and in the worst case, an additional four bytes. In both cases, it would also be a lot of work. I've been holding out hope that I would be able to spend some time to continue modernizing Aleph One's net code, and in the process of that, perhaps I could make those improvements. This is looking less and less likely now.
User avatar

treellama
Pittsburgh

Post Aug 16th '10, 16:47

Treellama wrote:Haven't you used Visual Mode.lua?

No, I've been an ardent Forge user since forever. VML is just too difficult to learn for me :(
User avatar

RyokoTK
Saint Paul, MN

Post Aug 17th '10, 02:00

I made some progress on this. I can determine which projectiles damage a monster, and the total number of projectiles fired, so I can calculate how many miss. This wasn't as straightforward as it should be, because projectile custom fields are not being invalidated when the projectiles are destroyed :(

So, I did it manually. Here's one thing I ran into: if you kill a normal monster with a shotgun, even if you aim perfectly, some of the pellets are going to miss him. On TC, it only takes six pellets to take down a major fighter, so if I start a game and kill one my accuracy drops to 60% right away.

Is this going to be a problem? I could try to think of a way to make it count shots instead of projectiles, but I think it will be very tricky.

How should the fists be handled? If you swing and miss, is that 0% accurate? What about TOZT, which fires very rapidly?
User avatar

treellama
Pittsburgh

Post Aug 17th '10, 02:57

Treellama wrote:I made some progress on this. I can determine which projectiles damage a monster, and the total number of projectiles fired, so I can calculate how many miss. This wasn't as straightforward as it should be, because projectile custom fields are not being invalidated when the projectiles are destroyed :(

So, I did it manually. Here's one thing I ran into: if you kill a normal monster with a shotgun, even if you aim perfectly, some of the pellets are going to miss him. On TC, it only takes six pellets to take down a major fighter, so if I start a game and kill one my accuracy drops to 60% right away.

Is this going to be a problem? I could try to think of a way to make it count shots instead of projectiles, but I think it will be very tricky.

How should the fists be handled? If you swing and miss, is that 0% accurate? What about TOZT, which fires very rapidly?

I would personally like the shotgun problem fixed, and fists probably shouldn't count towards accuracy. If you're making this for games like Eternal, staff melee probably shouldn't count either. The TOZT is probably fine as is.

While this is more long-run and difficult to do, you could try to code a "melee" setting into all of the weapons that can be changed from a future release of Physics Editor One. That way it would be easier to not count certain weapons (or I assume it would, at any rate).
Image
User avatar

gmanyo

Post Aug 17th '10, 10:34

Treellama wrote:I made some progress on this. I can determine which projectiles damage a monster, and the total number of projectiles fired, so I can calculate how many miss. This wasn't as straightforward as it should be, because projectile custom fields are not being invalidated when the projectiles are destroyed :(

So, I did it manually. Here's one thing I ran into: if you kill a normal monster with a shotgun, even if you aim perfectly, some of the pellets are going to miss him. On TC, it only takes six pellets to take down a major fighter, so if I start a game and kill one my accuracy drops to 60% right away.

Is this going to be a problem? I could try to think of a way to make it count shots instead of projectiles, but I think it will be very tricky.

How should the fists be handled? If you swing and miss, is that 0% accurate? What about TOZT, which fires very rapidly?


Good progress. Did the area effect projectiles cause any problems? And how did the AR-main trigger work in your opinion?

With the shotgun, what do you think about this idea:
5+ pellets = 1 hit
4- pellets = 1 miss
So each shotgun shot count as 1 hit or 1 miss.

Please don't include the fists and flamethrower.If you think they really should be included. Then fist hit is 100% accurate, fist miss 0% accurate. Flamethrower is perhaps best to count in seconds. Every second damage was inflicted = 1 hit, every second damage was not inflicted = 1 miss.
Last edited by goran on Aug 17th '10, 10:38, edited 1 time in total.
User avatar

goran

Post Aug 17th '10, 12:47

G.S.10 wrote:Good progress. Did the area effect projectiles cause any problems? And how did the AR-main trigger work in your opinion?

Area effect projectiles work fine. As long as you damage somebody, it counts as a hit. AR is OK, if you are very careful you can avoid firing shots after the monster dies. It's tough, though, you have to be up close. IIRC SMG fires in two bullet bursts, so it's possible it will throw the accuracy stats off if the first shot kills the monster, but compared to how many rounds the SMG fires, I don't think it's a big deal.

With the shotgun, what do you think about this idea:
5+ pellets = 1 hit
4- pellets = 1 miss
So each shotgun shot count as 1 hit or 1 miss.
I was thinking if any of the pellets hit, it counts as a hit? Either way, the code is going to get complicated.

Please don't include the fists and flamethrower.If you think they really should be included.

I think I will just not include these weapons in the accuracy calculation. They still count towards damage per minute / damage taken.
Last edited by treellama on Aug 17th '10, 12:49, edited 1 time in total.
User avatar

treellama
Pittsburgh

Post Aug 17th '10, 13:21

Do it so that if at least one pellet hits, it counts as a hit. That way you won't "miss" someone who's wounded and only takes one pellet to kill. The same should apply for the SMG, which spits out two shots at once.

I would count the Flamethrower, but maybe as 1/5th of a shot per tick or something.
User avatar

RyokoTK
Saint Paul, MN

Post Aug 17th '10, 13:30

1 pellet on the shotgun sounds good.
User avatar

goran

Next

Return to Projects



Who is online

Users browsing this forum: No registered users