Mobs Spawn (and probably despawn and Tick)
#14
Sorry guys.

There is still alot of work to do on this subject, and I may will, but as I do not intend to go inside a tunnel thing, it post a patch right now. As the version is stable.

Major issues are :
1. As the light level detection is not coded right now (I think that cChunk::UnboundedRelGetBlock do no return the right thing for lighting), there are alot of hostile mobs spawning everywhere
2. As there is no collision detection, there are alot of logs added during launches due to monster going inside walls
3. My opinion is that there are very few passive animals (sheep, cow ...) and I think it's weird. I tried to debug it, but I ended in the conclusion that this is the result of the implemented algorithm and not a bug
4. I never saw any Wolf or Ocelot as spawning condition in this algorithm is very rare

Plus you will find alot of things that are undone (tag is "MG TODO", or "TODO MG", or sometimes just "TODO" but i tried to avoid it)

Plus there are lot of things I may use you don't like, and I have done in a way you wouldn't have. Specifically :
- I never ended my CheckStyle rules, so this is possible there are spaces where you don't want and missing spaces or carriage return too)
- I used alot of static sets and maps, and I saw you do not use to do that.

Plus there are a lot of things I would have done to make thinhs cleaner and I refrained :
- I didn't use any namespace, but I really think this would be much better
- I would have used alot more typedef (as you always are carrying ints) (Oh ! I forgot, I couldn't refrain on that : I named the mob type enum)
- I didn't replace global things like g_BlockTransparent by static member of an object cBlockManager or cTransparencyManager
- ...

As we talked of this a little bit, I assume some of those refactoring are in your head too, but the lack of working forces do not allow you fight every battle.

Thanks

Note : this patch (when it will be finalized) will solve at least part of thoses tickets :
- 403
- 101
- 348


Attached Files
.patch   MonsterSpawn.patch (Size: 22.16 KB / Downloads: 222)
Reply
Thanks given by:


Messages In This Thread
RE: Mobs Spawn (and probably despawn and Tick) - by mgueydan - 07-19-2013, 04:06 AM



Users browsing this thread: 9 Guest(s)