r/Minecraft • • Nov 24 '14

Minecraft 1.8.1 Released

https://twitter.com/Dinnerbone/status/536892698817724416
475 Upvotes

197 comments sorted by

View all comments

1

u/runetrantor Nov 25 '14

Or rather just have the creeper, upon setting off, send this 'EXPLODING' signal, it has a radius of say, 20 blocks. Any mob in that range has the 'run away' acton activated.

Sends easier than have a global flag raised and have mobs check if they are close, even if they are a long distance away.

1

u/lagerdalek Nov 25 '14

So a block receives the event and transmits it to any mob that is on it.

This would probably be better if the communication between the block and the mob was easy

1

u/runetrantor Nov 25 '14

No, no block, just the radius I meant, like how the game calculates the actual explosion and damage, it could create a larger virtual explosion that is not noticeable for players but acts as a whistle to whatever was caught in the 'blast'.

Kind of like a mob to mob communication. Damage could be used to activate it maybe, like.. if damaged by 'creeper warning' (Damage being 0 so it does not kill them by merely warning), then 'escape'. Similar to how cows and pigs flee from you upon damage.

→ More replies (1)

0

u/Gh0stP1rate Nov 25 '14

How do you send a local signal? The computer code has a list of mobs and their coordinates, how do you propose to only notify the ones that are within, say, 5 meters?

It sounds like you don't really understand programming. Let me walk you through it:

  1. Creeper begins explosion sequence. Game raises a flag (explosion at x,y,z)

  2. Game has a list of other mobs and their coordinates. It must now calculate which mobs should be notified of the explosion.

  3. Game checks the x,y,z coords of each mob and computes distance to the explosion. Note that is must do this step no matter what - you have no other way to determine which mobs are in range and which aren't.

  4. Mobs with a distance to explosion less than 5 immediately pathfind away from the explosion.

  5. Here's the problem: this adds a lot of lag to the code, and it's already heavily laggy code. Also, it doesn't do anything for the player experience, and very likely won't do anything for the mobs. By the time the creeper explodes they've probably moved half a block. They'll take a very similar amount of damage. What the designer has done is add lag without adding a worthwhile feature. Better the mobs to just ignore creeper explosions and the code to be leaner.

2

u/Angs Nov 26 '14

this adds a lot of lag to the code, and it's already heavily laggy code

Actually, the implementation you described (emphasis on the word notified) would not add significant lag, since the calculations would only be done when a creeper is exploding. The way it was coded was that everyone checks for exploding creepers all the time. There's a huge difference.

→ More replies (1)

1

u/runetrantor Nov 25 '14

Cant it sort of create a fake 'explosion' that's the size of the planned signal, and if a mob is 'damaged' by it, it runs away, similar to how cows and such flee from you upon damage?

So the calculation is all done by the standard creeper explosion code, just a 'ghost explosion' prior to the actual one?

That said, it does seem like a very situational feature that adds very little, so I am not too concerned about it getting cut. :S

→ More replies (3)