Mob limit - Printable Version +- Cuberite Forum (https://forum.cuberite.org) +-- Forum: Cuberite (https://forum.cuberite.org/forum-4.html) +--- Forum: Development (https://forum.cuberite.org/forum-13.html) +--- Thread: Mob limit (/thread-218.html) Pages:
1
2
|
RE: Mob limit - FraNkYWIllS - 12-20-2011 Yeah better perhaps they also should have there own m_Health. So we can set how much health they have. ALL pawns already have health, so you don't need to add anything. RE: Mob limit - FakeTruth - 12-20-2011 What are you talking about? RE: Mob limit - Lapayo - 12-21-2011 Hey, for your Problem with the Pickups, which were crashing the client: I came across the same problem. But after a while a found the bug. The cItem-Class is causing this. if(!isValidItem( m_ItemID ) ) m_ItemID = E_ITEM_EMPTY; is in the cItem constructor.. and now.. raw chicken etc arenĀ“t in IsValidItem so the itemid is E_ITEM_EMPTY. And sending an E_ITEM_EMPTY to the client seems to crash it. (IsValidItem is in Defines.h) So i updated the Function and the cPickup to prevent it sending E_ITEM_EMPTY for the future This is basically what you have to do RE: Mob limit - FakeTruth - 12-21-2011 Ah okay, makes sense! Should add a check in cPickup then, to see if the Item ID is 0 (or -1) and output an error in te log if so RE: Mob limit - NiLSPACE - 12-25-2011 (11-10-2011, 10:13 AM)rs2k Wrote: I think the world class should gain m_MobLimit, m_CurrentPlayers and m_CurrentMobs. If ( m_CurrentMobs * m_CurrentPlayers > m_MobLimit), then no more mobs can spawn. When a mob spawns add + 1 to m_CurrentMobs, when it is removed, remove one from it. Same thing with m_CurrentPlayers. sounds great there are too many mobs spawning now RE: Mob limit - AsianBusinessman - 12-25-2011 (12-25-2011, 02:08 AM)STR_Warrior Wrote:(11-10-2011, 10:13 AM)rs2k Wrote: I think the world class should gain m_MobLimit, m_CurrentPlayers and m_CurrentMobs. If ( m_CurrentMobs * m_CurrentPlayers > m_MobLimit), then no more mobs can spawn. When a mob spawns add + 1 to m_CurrentMobs, when it is removed, remove one from it. Same thing with m_CurrentPlayers. I have been following this project now for a couple of days and I have to put my thoughts into this. First from what it looks like the whole mob spawning that is currently implemented is more proof of concept than anything. The correct way to spawn mob is definitely not to just spawn them at random intervals around the player. Again this seems like a proof of concept. The main reason I saw this is because you are talking about adding all kinds of new methods/variables to the world class, but all this is going to do is bury it deeper so that when it is changed it is harder to do. The way it probably should be done is to spawn mob with the chunks that are loaded around the player. They would have probabilities of spawning based on lighting/biome/location etc. With this you can add a limit for the number of mob per chunk which will also inherently create a 'mob limit' for the world, but based on the number of players/chunks loaded. Let me know what you think, and this is my first post so hello everyone. RE: Mob limit - FakeTruth - 12-25-2011 (12-25-2011, 10:01 AM)AsianBusinessman Wrote: I have been following this project now for a couple of days and I have to put my thoughts into this. First from what it looks like the whole mob spawning that is currently implemented is more proof of concept than anything. The correct way to spawn mob is definitely not to just spawn them at random intervals around the player. Again this seems like a proof of concept. The main reason I saw this is because you are talking about adding all kinds of new methods/variables to the world class, but all this is going to do is bury it deeper so that when it is changed it is harder to do. Hi and welcome to the forums This does sound like a good idea! Thanks |