• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Smart Region Indexing

Status
Not open for further replies.
Level 20
Joined
Jul 14, 2011
Messages
3,213
Well, I'm making a Bomberman map.

Every bomb is placed on the position of the caster, and that bomb is centered on the region the unit is standing at (all the map is covered with 512/512 regions)

Now, I create 4 dummies everytime a bomb explodes and move them in each direction, these units kills or destroys anything in the path (unless they colide with a structure or a highger clifflvl) But using dummies that way leaks a lot, and takes too much resources. Besides, I would like to create an Exclamation Mark on the squares that any of the bombs will reach, so units can escape (if they're fast enough).

I think that creating 1 Killer and 1 exclamation mark in each region, and unhiding it when is reached by a bomb and give the owning of the unit to the owner of the bomb that exploded, so the kill goes for that player, and then hide the unit again... Would be more efficient, but way harder for my brain :$

I could also Pick every unit in a given region but that would require a lot of Group creation and Destroying (Unless I add every unit in the region to a group, kill them, then clear the group).
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Hmh, I thought I get it... but then again, maybe I don't.
At first I thought that you divided the map into grids (regions), where a bomberman can only move 1 grid further. But 512x512 regions are massive, so that kind-of ruins that idea.

Since I'm kind-of bad at explaining, I've attached a map that uses grids (it's not an actual game though, I just made it while bored).
Imagine the tank-like thingy is a bomberman. He can only move on the grids in a non-fluid motion (it's possible to make it fluid, but I didn't). Imagine he drops a bomb: an exclamation mark will appear over every grid horizontal + vertical from the bomb ( X grids away ). Then it explodes, creating a firewave (or whatever) that covers the exclamation points and makes them hide once it has passed them (firewave can be non-fluid as well as fluid).
Is that what you're trying to create, or are you using some other system?


Just a quick question: do you use vJass (or have any plans of using it)?
So far all evidence points towards "NO!", but who knows? People change...
 

Attachments

  • GridCheck.w3x
    15.6 KB · Views: 38
Level 25
Joined
Jul 10, 2006
Messages
3,315
512x512 regions?

So for each bomb you'd need 1023 markers and damage points.

For your "pick every unit in region", you should declare a new region variable that stretches from one end of the map to the other to pick units for death, and then for the special effects you should just handle each one individually with a timer, and maybe a buffer removal system.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
With 512x512 I meant this. There are 120 (or so) regions

attachment.php


I just use the regions basically to center the bombs on the region and to know if the region already has a bomb.

@ap0calypse: Amazing grid thing! But sadly that's not how i'm working. The map is pure jass, but still it's just an Optimized GUI, nothing too complicated.

The distane the explosion travels is 1 region per Strength.

If i have 2 strength, the bomb should explode 2 squares (2 regions) to each direction. Distance from the center of each region towards any other around is 512.00.The walls are there to block the dummy path.

Most of these regions have a Building that blocks the map. I just hid them to see the regions more clearly.

I just create the dummies facing 0, 90, 180, and 270. And move them towards their facing 512xStr. Dummies have Inmolation and Phoenix fire, so they kill anything in the path. If Cliff is 3 (default is 2) the unit is removed. If dummi kills an structure, it's removed too.
 

Attachments

  • Regions.jpg
    Regions.jpg
    533.7 KB · Views: 189
Status
Not open for further replies.
Top