Comments (3)
Thanks for the suggestion, but unfortunately I don't understand what you mean.
(The higher goal makes sense but I don't see how your intended solution would look like right now).
Can you rephrase it and/or post the current, slow solution?
from demoinfocs-golang.
Aim: As I said, I need to make some game situation checking before or after an event has been occurred (lets named pre/post checking events). Let's say, there is a feature named first kill, which the total number of first kills made by a player each round. In order to a first kill being valid, the killer needs to be survived after 2 seconds of kill event. So, I need to schedule a post checking event 2 seconds after this kill event.
Naive solution: A very naive solution will be a scheduler implementation. There would be a list of pre/post checking events already specified in which ticks they will be executed. On each tickEnd, the scheduler iterates all event list and checks whether an event is needed to be executed. However, the solution will be slow that's because, on each tickEnd, you need to check all listed pre/post checking events.
Proposed solution: What I suggest is that instead, Is there any way to implement these pre/post checking events using generic event you implemented and adding/inserting the parser parsing path. So, when the tick occurs, the parser will dispatch these events just like any other events like kill, death, etc. This will provide enormous flexibility to the user to implement own custom events and these events can be triggered when they are supposed to occur. Another benefit is that the user can use his / her own custom events only registering an event handler (For all ideas, I suppose, I have already known in which tick each pre/post checking event should occur).
from demoinfocs-golang.
I'm not sure if there would really be a too big performance improvement. We could skip the reflection calls needed for TickEnd
but that's about it, the rest would be the same implementation as the 'naive' version, just inside the library. It would have the same speed as if you did it yourself.
Or am I missing something?
The lib also used to support custom events in a different way but it wasn't really useful and got removed.
from demoinfocs-golang.
Related Issues (20)
- Player equipment incorrect HOT 6
- How to get crc-map code? HOT 8
- Missing - Unknown granade model HOT 1
- There is no kill events on Esportal demos but kills are there when demo is played with the game HOT 3
- interface conversion: interface {} is *sendtables2.fieldState, not uint64 HOT 1
- Missing player in TeamState.Members() HOT 6
- No ItemDrop events fround from CS2 demos HOT 2
- Players are assigned to the wrong teams HOT 13
- Events are not firing in CS2 GOTV demo HOT 5
- Parser crashes after CS2 update 2/6/2024 HOT 18
- Parsing is crashing with signal: killed (CS2 update 2/6/2024) HOT 1
- panic: serializer CWorld: field path has no field (CS2 update 2/6/2024) HOT 1
- Proper support for polymorphic fields HOT 1
- Go 1.22 is not supported HOT 1
- Event PlayerDisconnected is not triggered anymore for bot leaving the game (on v4.0.2, it was working on v4.0.1) HOT 1
- Bot doesn't leave connected player list after PlayerDisconnected event (it was working on v4.0.1) HOT 1
- unknown equipment with index 526
- POV demo support for CS2 HOT 2
- generate heatmap and nade trajectories - invalid memory address or nil pointer dereference
- Possible panic since v4.1.0 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from demoinfocs-golang.