All times shown according to UTC.

Time Nick Message
00:09 evenniacode_ [13evennia.wiki] Griatch pushed to page 'Links' 02https://github.com/evennia/evennia/wiki/Links
00:09 * Volund glomps Griatch! rawr!
00:09 Volund I just finally settled on a muzzle method
00:22 hrm. futzing with time is actually an interesting conundrum.
00:23 this idea poses an interesting challenge.
00:25 If I wanted something to happen at a very specific time - such as a message to occur -exactly- when a certain duration had passed based on the date, not how long the system was running... I could do this in several ways. I could have a script running extremely frequently and checking to see if 'set date < utcnow()' I suppose
00:25 frequently as in like once per minute
00:27 evdemo [Public] someone: hi
00:27 Volund hello!
00:28 evdemo [Public] someone: are you the evennia developer?
00:29 Volund No, that would be Griatch and Kelketek. But I can answer plenty of questions. what's up?
00:29 evdemo [Public] someone: nothing really, just found this project tonight... just poking around
00:29 [Public] someone: i'm a developer, who played LPMud some years ago
00:30 Kelketek I live, despite the attempts of my enemies.
00:47 Volund BEHOLD
00:48 http://dpaste.com/0KK6X9C
00:50 I have determined that working with nested dictionaries -really- sucks though
00:50 I like flat lists. :|
00:51 Kelketek Volund: Have Thomas the Dank Engine in consolation. https://www.youtube.com/watch?v=KMQgvv6ngO8
00:51 * Volund clonks
00:51 Volund so kelketek, time-based stuff
00:52 I've just begun to realize how incredibly complex this IS.
00:52 like, I'm pondering now how game AI and other things -works- and, well...
00:52 hoooly shit.
00:52 but the backbone of it has to be some kind of thing running constantly that says 'make the next moment happen. figure out what that is and do it'
00:53 Kelketek There are a lot of tricks to it.
00:53 Like there's no need to evaluate AI that's not in the realm of the user's current experience, for instance.
00:54 Volund that depends on the game, but true.
00:54 you might have a game that has roaming mobs that fight each other, as an example.
00:54 (not sure what the point of that would be, but you get what I'm saying.)
00:55 Kelketek The point of that would be to waste CPU cycles. You can do quick calculations to fake full battles off screen if you really need that stuff to progress while the user does other things.
00:55 Volund well yes.
00:56 but what I meant is that -something- is still deciding that things are happening
00:57 here's what I mean here
00:57 Kelketek Yes. But! Could just be that the calculations aren't even done until the user arrives in the relevant area, and are instead just completely ignored. No special timer involved. In which case your polling function is 'did the user do something' and 'what should have happened in the interleving time?'
00:58 Volund okay so that's not what I'm saying.
00:58 Like, okay, here
00:58 I have this 'restrict a player from a channel' thing here. it expires at a specified date in the future.
00:59 Kelketek Ok.
00:59 Volund now, the logic for making the block work is fine. 'if now < expiration date, block message'
00:59 BUT what if I wanted a message to fire off the instant that muzzle expires?
00:59 SOMETHING needs to be aware of its expiration date and when that is reached.
01:00 the simplest implementation I've just realized is a loop that figures out 'what muzzles exist, whether it expired, and if so run the message and delete it'
01:00 but this is limited to how often the loop runs.
01:00 Kelketek I think there's an example of that in the docs already
01:00 Volund so it might be 50 seconds off. Now, I personally don't care.
01:01 the TickerHandler seems to be the closest example to something like what I'm talking about
01:01 Kelketek Volund: https://github.com/evennia/eve[…]iki/Async-Process
01:01 Check the 'delay' section
01:05 Volund yeah. I use delay to insert a small delay until after the user has logged in before it executes +bbscan
01:06 and run_async definitely looks like it'll be a good idea to put around anything like background maintenance/integrity checks.
01:07 (not sure, but if the idea is that it makes the impact less noticeable, maybe that's good? I dunno)
01:12 Lemme approach this from another example though. for a game like X3: Albion Prelude, the AI-run ships flying around have sensors. they are each aware of what's in their sensors - if they detect something they're hostile towards they decide 'I am going to attack that' right then and there. They don't wait 20 seconds for the next tick to tell them this. In general, the world and AI of a game reacts to a situation seemingly
01:12 instantly. For this to happen however, some kind of loop needs to be running at very high speed. I -think- the closest thing to this in Evennia is the tickerhandler...
01:14 I'm just trying to figure out what exactly is -happening- for lots of software that handles things like build queues or scheduled events...
01:15 (and yes, you're also correct: while the simulated world of X3: Albion Prelude does Have Things Happening even where the player isn't, anything OUT-OF-SECTOR is handled using extremely simplified algorithms)
01:16 Kelketek Volund: Or you could have some hook in move_to that makes things in an area aware of what arrives
01:17 Volund for a MUD-style, sure. it could do things like 'check all contents, check the skill levels of anyone to see if they notice and message those who succeed'
01:18 Dalgraef joined #evennia
01:18 Kelketek Yes, sorry, I'm only half paying attention. Running a sort of virtual auction in another window.
01:18 Volund oh
01:19 Dalgraef That thomas the tank engine remix is distracting
01:20 Kelketek It's culturally enriching.
01:20 Dalgraef I've been developing my own Python MUD framework for the past few weeks. Any tips for combat systems? I'm almost at the point where I need to start making one
01:21 Jeshin My advice on combat design is to keep the underlying logic behind it simple but give varied options.
01:22 Volund aha!
01:22 I found my answer
01:22 http://gameprogrammingpatterns.com/game-loop.html
01:23 Dalgraef So make it extensible so that I can easily add new weapons/effects/etc.
01:26 Jeshin I would say yes. You may want to map out what 'components' you're going to have so you know what you need to account for in terms of code structure.
01:27 Like will you have ranged, will you melee, will you have hand to hand, will those all operate under the same to-hit algorithm?
01:29 Dalgraef I'll write out a list of the basic attributes I'll need. Types of damage, item use etc.
01:29 Thanks
01:29 Also, where can I find the implementation of rooms in the Evennia source? I want to see how you made doors
01:30 Jeshin Someone else would have to help there
01:31 Dalgraef ok, thanks anyway
01:31 I'll hunt around for it
01:50 Volund okay so
01:50 it looks like if I wanted to implement something akin to a 'fairly active AI and ongoing events' I would probably use the TickerHandler with some fairly elaborate hooks.
01:51 to an extent
01:52 if I ever want to do mobs, I will investigate better
01:56 Dalgraef I'm new to this codebase. In TickerHandler you subscribe an event to the ticker. This event is in the form of an "obj". What type is that object? Is it a function to be called every tick, or is there some Event class that you would use, that has a function stored inside of it?
01:58 Volund obj needs to be an instance of anything that uses Evennia's typeclass system.
01:58 so a Player, Object, Room, Exit, Character, Script, etc
01:59 it'll most often probably be an Object or Room though
01:59 Dalgraef okay
01:59 Volund meaning an in-game object, not a code object.
01:59 Dalgraef yah
01:59 and the _GA is getattr?
01:59 so you would have a method on the object that you want called by the ticker?
01:59 Volund https://github.com/evennia/eve[…]iki/TickerHandler
01:59 Dalgraef oh, thanks XD
02:05 So, set up a hook on your NPC that ticks every few seconds, and decides what action to take based on a some sort of state machine. Each NPC would have to have a bit of an offset so it doesn't look like every one is just moving every few seconds.
03:01 * Volund has begun using continue more to avoid nesting
03:13 AlanDill but nesting is so snuggly
03:22 Volund okay screw it. I'm gonna use a django model for muzzle entries. nested dictionaries SUCK
03:31 Kelketek Volund: What about tags?
03:31 How complicated do muzzle entries have to be, really?
03:31 You have the channel they're muzzled on, and when they should be freed, right?
03:31 Volund I would like to track 'when it was set, who set it, what whether it's for a channel, a group, or global, and when it expires'
03:32 so yeah, I'm doing a quick Django model
03:32 Kelketek OK
03:32 Volund it's just ten times easier because it -stays flat- that way and I can easily sort it
03:32 also easily clean it
03:32 'for all entries, if duration expired clean entry'
03:33 instead of hunting through three different formats... etc.
03:33 y'know what I'm saying?
03:33 Kelketek I suppose so, yes.
03:38 Volund I can just use a minor bit of caching to ensure the database isn't hit as often. :D
03:38 now that I know how that works, mwahah
03:39 since channels are used -constantly,- using caching there makes a hell of a lot of sense.
04:46 it occurs to me that I could very easily convert the Group django model to use DefaultSCript as its parent - and thus, easily gain access to the lock storage and .db and .ndb...
04:47 could change setup_group method to use at_script_creation() and have each one cleanup its own stuff...
04:51 * AlanDill scrubs Volund's brain with a wire brush
04:51 AlanDill there! Code now!
04:51 :P
04:51 Volund yeah, I'm gonna make that change. it will be much better for several things in the future
06:14 woooo
06:14 switchover to ScriptDB complete
06:14 my Groups are now Scripts
06:55 * Volund DEVOURS EVERYTHING. is hungry dammit
07:32 Greymtr joined #evennia
07:43 Volund Channel Muzzling is IN
07:46 woo
07:46 okay that's enough for today
07:47 tomorrow I work on page
07:57 Greymtr joined #evennia
08:01 Volund and maybe @mail
08:27 huzzah either way
08:27 page will be -easy- compared to the channel futzery
08:32 AlanDill you are like a machine Volund
08:51 Volund :D
09:22 allie_madison joined #evennia

← Previous day | Index | Server Index | Channel Index | Today | Atom Feed | Search | Google Search | Plain-Text | plain, newest first

Evennia