1

Topic: Visibility code and garbage collection

Last week I was doing the visibility code, such that the server will send only what it needs to and players won't know about anything else. It seems to work, so I'll find out when I begin to seriously use it. One problem with the code as I did it was that creatures can see each other, but the creatures being seen may very well be able to see the ones that are seeing.

That gives us circular references. Not fun. Reference counting won't work, but I didn't want to use ordinary pointers since that'd complicate everything. So, I switched all of the game's memory management over to garbage collection. I rolled my own since I thought it'd be fun, and what a pain it was. However, now the game's working fine with that, except the client crashes on exit. All that's left to do is to debug and integrate Squirrel's garbage collector with my own. That'll let scripts safely keep references to objects, and objects to script objects, etc. Pathfinding doesn't get along with the new visibility system yet, so that's another bit of work.

However, *after those* (the above issues are minor), here's what we've got, in (roughly) the order I think I'll implement them.

To-Do:

* Sight radii for creatures
It remains to be seen if the visibility system can be made efficient enough that monsters won't have to cheat. While it's clean, speed, well...
Anyway, if I give a creature a sight radius, and attach a client relay to it as a viewer, the client will be able to see everything the creature sees. This is so we can do pets *right* and perhaps play RTS style.

* Serialization within the map for more complex objects
There's no technical reason I can't serialize any object within the map, but I want to keep it limited to those it makes sense for.
Monster spawners come to mind.

* Monster AI
As I mentioned before, creatures already have 'goals', but those are only actions for an AI to use. We still need general behavior.
I'm going to try for 100% scripted.

* Chat channels
While chat is operational, I don't have any default channels decided on. Keep broadcast? Yell? What. I'd like your opinions.

* An understanding of 'maps' on the client
Presently the client has no clue what a map is. This is fine for now, but if we're going to be watching pets on multiple maps at once, the client'll have to know not to show map 2 tiles when we've got a map 1 creature highlighted, even if it knows about the tiles.

* Mouse-based map scrolling (like Starcraft)
Only for RTS mode, but once all of the above are done... For GMs I'll have it attach a viewer to the camera, so that we can watch over anywhere on any map at any time.

* Completely rewritten pathfinding
The pathfinding code is an impenetrable mess. Now that I have proper restrictions in place, it should be easier to write cleanly, and will probably take about an evening. The current code tries to do too much, and does it badly. Along with this I'll introduce stairs, since we need them.

* Accounts
Everyone's named Test right now. smile

Suggestions, comments, etc. are welcome. Pretty soon I'll need to be thinking about stat systems, game mechanics and what have you. That's the part I actually enjoy, so this'll be picking up speed.

2

Re: Visibility code and garbage collection

Sounds like good progress is being made Zer.

One little peeve I have with Faldon's current stat system is that you must have mixed up stamina and constitution... constitution presently decides your energy regen and stamina presently decides your health points.  Shouldn't it be the other way around?

3

Re: Visibility code and garbage collection

Sounds great. RTS = real time strategy right? Meaning controlling pets? Chat is fine to stay on broadcast, but it could be broken into different chats rooms. Like one for new people, merchants, off topic, then normal game chat. Oh and if someone is selling on another chat you could make it, if it finds the keyword "selling" it also posts it in the merchant chat. And a temp filter to see your t's,g's, etc
then take it off to see the bchat without missing anything- would be very helpfull.
I think the stat system should be totally remade, but to what, that should be on another topic to argue about.

I keep my ideals, because in spite of everything, I still believe that people are really good at heart.

4

Re: Visibility code and garbage collection

Oh so much to argue about... Im looking forward to it.

5

Re: Visibility code and garbage collection

Yep indeed, I've started to look at different stat systems. Oh about pets, this could make animal taming way more fun by doing what black&white2 does for there creature pets. Able to teach it not to do a habit or able make it do that habit more. e.g when attacking random people, guarding, fetching something, training, shitting on people etc.  And the higher animal taming you have the more you can teach it to do or not to do that habit(teaching could be done by hitting it or by feeding it treats). You could make pets have there own stats which they increase them selves according what they good at. You make it that when pets increase there lvl some can increase there model size. Oh and able to hire a guard, could be similar to pets but without the teachings. Like a hired guard will have a set moral of things for what to do and not to do. And able to lvl and such, maybe able give it items to wear? But instead of feeding it you give it gold e.g a days work would be 100 gp.
More smarter AI to town guard would be good, that it attacks evil monster or any creature that attacks in town. If it sees a person doing something wrong instead of attacking him straight away give that person a option of paying, going to jail or being attacked. Clicking on a guard, you talk to it not attack it.

So if you could make creatures with that advance AI that would be great.

I keep my ideals, because in spite of everything, I still believe that people are really good at heart.

6

Re: Visibility code and garbage collection

Mmm,

Make static trade routes.  For example in this client, a caravan could travel from Valour to Midguard (a new town on a different map which is connected by a brick road directly to valour), but could be robbable.  It would have to be difficult to rob but increasingly so as the average level of, say, the top 500 players rose.  It would also need to have increasingly more gold. 

Special monsters that spawn only once a week or once X period.  These monsters have a X chance (fairly high, something like 25%) of dropping this one item.  On saturday night at midnight every week, there's a scramble to get to these general locations where these monsters spawn.

7

Re: Visibility code and garbage collection

Special monsters spawning once a week is a possible scripted for this client. For example could make a npc say like a scout. And could draw a random number, once every faldon day, which if your lucky could say he saw such a monster, and he will give you info where if you pay him. Then he could spawn that monster and then tell you around about area where it is.
Yea I want caravans and carts, and will be now possible, it be like a boat but on land.

I keep my ideals, because in spite of everything, I still believe that people are really good at heart.

8

Re: Visibility code and garbage collection

The problem with town guards attacking monsters is that in the olden days players abused it.  They would lure a monster into town and allow the town guard to attack it.  When it was weakened, the players would kill it for the experience and/or take the drops.  The current behavior of the guards ignoring monsters is a direct result of that.

9

Re: Visibility code and garbage collection

Well in this current system. But I believe the xp system should be changed. There was a post about this a while back. That the % of heath you hurt it the % of xp you get if it dies. Therefore if they did kill the monster they would get crap all xp. And if the maps are set out right there wont be any hard monsters anywhere near the town.

I keep my ideals, because in spite of everything, I still believe that people are really good at heart.

10 (edited by Spectre 2007-02-11 10:02:21)

Re: Visibility code and garbage collection

Even if the map is setup so that hard monsters are far away from town (which I agree with), it doesn't prevent people from LURING monsters into town.  Which is what used to happen.  The ungodly demon of doomspike might not have spawned anywhere near town... indeed, it could have been all the way across the map.  But, if a player gets close enough to be targeted by the monster then starts walking to town, the monster will follow them all the way.  If we make the AI such that monsters don't continue to follow, now you have the issue of players taking a few shots at the monster, running to heal, coming back and repeating till dead.  Kind of lame, imho.  Now, perhaps with the new system wherein all monsters could be scriptable, we could have different styles of AI.  Something like a woodland creature would be much more likely to run away until somewhat cornered or unless it felt it was stronger than the aggressor, but not pursue if the attacker runs away.  A common monster, such as say a goblin, might attack but run if it finds itself losing and perhaps will give chase up to a certain distance... after it's left it's "home" by, say, 100 tiles, it tires and wanders back.  But, perhaps a more aggressive monster such as a wraith would follow its target to the ends of the map (and perhaps through portals?). 

I think that if guards are to attack monsters, it should be the UO approach:  if a monster is attacked by guards, it's instantly destroyed leaving no drop and no chance for a player to attack the weakened monster.  This could be literally destroyed, or perhaps simply just warped back to its spawn point (so that any items it has picked up are still on it - that way if you drop your uber sword of coolness when the monster kills you and it picks it up, it didn't die when the town guard nuked the monster).

Well, I'm a fan of the idea of getting xp based on the amount of damage you do to it.  I've proposed the idea before and I would hope that Zer will consider it during the rewrite.  The problem that has been brought up about it is the concern of monsters healing.  If I do 99% damage to the monster and let it heal then kill it, do I get 199% experience or 100% exp?  If I would get 199% exp, now we have a clear opportunity for abuse.  If instead, I only get 100%, then how is it all based on?  If I attack a monster and get it down to 1% HP and it kills me, then it heals to 20% and someone else kills it, do I get 80%? 0%? 99%?  Then the problem also becomes, assuming you only get a small percentage of exp if someone already has attacked a monster, what happens when someone attacks a monster and lets say takes it to 1/2 HP and dies.  If the monster wanders and heals to 100% and you come around and kill it, do you get 100% of the exp or only 50%?  It wouldn't be fair if you had to only get 1/2 the exp despite having to do 100% of the required damage.  There are serious flaws in the idea because of monster healing.  But, if a workable solution can be found, I'm all for it.  I think it's really, really lame that players level by spawning masses  of slimes and then kill the monster with one hit.  Or, the idea of a low level player stealing a kill at the last second and gaining lots of exp when they did nothing.  So, if we can brainstorm some ideas, that would be good methinks.

I have some ideas regarding the experience system that I will post in a new thread to keep from changing topics here and so that replies to it will all be relevant to the topic.

11

Re: Visibility code and garbage collection

My concern with respect to broadcast is that one player who happens to be angst-filled can spoil the mood of the whole game for everybody. If you can think of a way to work around *that*...

12

Re: Visibility code and garbage collection

By the way all, Squirrel's GC now works with mine, pathfinding and the visibility system kind of get along (I'll rewrite it later on, the implementation is at least sufficient now), and accounts can take on any name. I have account registration web-based right now along with e-mail verification, and characters are created in-game. Since accounts are working, so are tells and says. Still haven't put the default channels in yet.

Pathfinding and the object link code are going to need some serious cleanup.

13

Re: Visibility code and garbage collection

Well if we have some anti spam protection then people wont be able to spoil the mood. Like the swear filter to be always on in bchat. People cant type more then 5 messages under 15 seconds and 10 lines without people chatting for 30 seconds, etc. And if accounts are e-mail verified then that would stop a heap of spam itself. More muting options for Gm's would help a lot. Like offline muting, so people cant spam there last message and leave. Able to set the time length for there mute/account mute and email mute?(thats if more then account can be created by one email).

I keep my ideals, because in spite of everything, I still believe that people are really good at heart.

14

Re: Visibility code and garbage collection

Hmm.
Actually I prefer swear filters to be optional; that way people who don't like them won't actively try to evade them.
That's what we do in the current Faldon client... maybe if I just made the messages not appear at all with the filter enabled instead of just bleeping. But the words aren't the problem, the content of what people are saying often is IMO, and no swear filter is going to be able to fix that

15

Re: Visibility code and garbage collection

Yea I don't really like a swear filter(really hated runescape one), thats why I just said for bchat. But more Gm options should do the trick anyway. Maybe also a new command like warning command that would bring up the TOS, highlighting the language ones(though this could be easy scripted I guess). Maybe a report button for  anyone to report a 'bad' person and Gms could access these reports.

I keep my ideals, because in spite of everything, I still believe that people are really good at heart.

16

Re: Visibility code and garbage collection

The problem with a 'report' feature is that with Faldon players, they'll simple fill them out complaining about whoever for no reason and send them to us.  Essentially spamming us and making the report feature worthless.

17

Re: Visibility code and garbage collection

My biggest argument for keeping the broadcast (or something similar) is that much of Faldon is and has been about the community.  There are those who log on solely to chat with others.  Clearly, the broadcast also gives voice to idiots, but I think that some form of broadcast needs to remain... even if it's an option.  For example, to borrow from IRC, if there was a "/j global" option or something.

18

Re: Visibility code and garbage collection

Spectre wrote:

The problem with a 'report' feature is that with Faldon players, they'll simple fill them out complaining about whoever for no reason and send them to us.  Essentially spamming us and making the report feature worthless.

Well of course some anti spam features are added. Lots of games have a report button so there must be some use to them. Maybe only can report the same person once a day, can only report every 20 min, and max 5 reports a day. Then anyone still abusing the report button can be warned and then a ban if have too.

I keep my ideals, because in spite of everything, I still believe that people are really good at heart.

19

Re: Visibility code and garbage collection

The thing with report buttons in most services is that they ussually involve constantly monitored services, where a supervisor of sorts can manually check in on a report of misconduct.  Being a big fan of irc chat, I'm with spectre's idea.

20

Re: Visibility code and garbage collection

Well I rather people try to spam the reporter then a Gms email. The reporter can be just optional, and if Gms are always hidden(no gm title in chat) to the public next client there has to be some way for player to report cheaters and people harassing other players.
What you mean punished unfairly?
If the Gm see that player do something bad as what the report says then he should be punished. Of course wouldn't just trust the player that reported. And for people logging other chars to spam reports just make it max 5 reports per account per faldon day or per account email or per ip. Or all 3 if your that worried heh.

I keep my ideals, because in spite of everything, I still believe that people are really good at heart.

21

Re: Visibility code and garbage collection

Well the client will be email certified for creating accounts so that would stop many people just from creating random accounts, and if theres ip/account/email banning any type of spam can be controlled. Oh about Gms being hidden I guess thats what wu and I think spectre wanted, but then there could be a command to turn the GM in front of the name on or off. As for reading tons of useless reports, It would be better then emails and game mails which I used to get. While a report anyone can check it out the player reported and just delete the report when done and I never said anything about trusting what people say Gms would still have to check it out.

I keep my ideals, because in spite of everything, I still believe that people are really good at heart.