View unanswered posts | View active topics It is currently Thu Dec 26, 2024 4:54 am



Reply to topic  [ 22 posts ]  Go to page 1, 2  Next
 Control over MOPixels 
Author Message

Joined: Mon May 26, 2014 4:10 pm
Posts: 9
Reply with quote
Post Control over MOPixels
I want to reproduce M.I.D.A.S. from Front Mission 3:


In order to make that, i need to know how to "select" everything in some circular area and delete (replace to air, i guess).
Of course i can solve the problem by creating round(6.28*r) bullets and adjusting their direction and speed, and blah-blah-blah, but:
1. I need to create special effect of explosion too (huge fireball).
2. I think that will lag as hell. Creating thousands of bullets a tick will never be fast.

Let me repeat myself: i need to have _all the ground, actors, creatures_ to be destroyed without leaving a trace in some area. Slowvy and nicely. And without lags.

The rays aren't a problem, though. It's just some bullets with infinity trace length and with certain speed. I don't think there will be some problems with making them.

So...
1. Fireball starts to grow with low speed while rays are shot at some point and stopped thus the trace won't disappear.
2. Fireball starts to grow faster and faster, while rays go less far, but they still exist.
3. Fireball consumes rays and their trace disappear.
4. Fireball suddenly disappears and cause gravitic pull far further, than fireball radius.
5. End.


Other idea is seismic and shock waves.
First one spread through the ground, causing some MOPixels to be thrown in the air and actors too (depending from strnegth and mass). But i want to make them more realistic, so, they should lose their strength as they go further.
The same for shockwaves, but those spread through the air instead of the ground.
In order to make that i need to know how to get what item or terrain at some coordinate at map. Strange, i haven't found something like
Code:
pixel_info = map[x][y]
in the wiki.


Wed May 28, 2014 2:59 pm
Profile
User avatar

Joined: Fri Aug 20, 2010 4:45 am
Posts: 911
Location: No Comment.
Reply with quote
Post Re: Control over MOPixels
On the subject of Front Mission*

Will you be doing anything else? say like the later releases, i did enjoy Front Mission: Evolved.


Wed May 28, 2014 3:26 pm
Profile

Joined: Mon May 26, 2014 4:10 pm
Posts: 9
Reply with quote
Post Re: Control over MOPixels
I don't think so. To be honest i always try to reproduce M.I.D.A.S. when i start to learn modding of something. That's pretty hard task, though.

But... CC definetaly needs to have METHAN wanzers, lol.


Wed May 28, 2014 5:12 pm
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post Re: Control over MOPixels
You can cleanly remove actors by setting them to ToDelete = true. Like,
Code:
actor.ToDelete = true;

To clear terrain, you'll need to position an MO to where you want terrain to be removed, and then do
Code:
yourMO:EraseFromTerrain();


Thu May 29, 2014 12:06 am
Profile

Joined: Mon May 26, 2014 4:10 pm
Posts: 9
Reply with quote
Post Re: Control over MOPixels
Quote:
To clear terrain, you'll need to position an MO to where you want terrain to be removed, and then do

Wait a minute... there's no way to do that without positioning? Moreover, what to do with seismic waves then? They should rip the ground apart.


Thu May 29, 2014 1:50 am
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Wed Sep 05, 2007 4:14 am
Posts: 3966
Location: Canadida
Reply with quote
Post Re: Control over MOPixels
If you can't do it directly, you are going to have to do it indirectly.

At best I can think of is that you need to progressively scan each surface (interface of terrain to open air) of /x/ free space, and spreay a few particles of /y/ material, or just spawn some invisible/non-colliding MOPixels at the surface to you get the whole ground-ripping.
That, or use this as the basis of the ground ripping, set aside the fact that you'd probably want to replace the gibs with something else.


As far as the lasers go, you could just gib the MOIDs that intersect the laser, and then just delete the resultant MOPixels, or so on.


Thu May 29, 2014 6:16 am
Profile

Joined: Mon May 26, 2014 4:10 pm
Posts: 9
Reply with quote
Post Re: Control over MOPixels
Quote:
At best I can think of is that you need to progressively scan each surface (interface of terrain to open air) of /x/ free space, and spreay a few particles of /y/ material, or just spawn some invisible/non-colliding MOPixels at the surface to you get the whole ground-ripping.

Not bad, but it won't work for higher than fireball buildings because i can't just spawn these particles on top of it.

But here's another idea, though.
Instead of scanning terrain and spawning particles on top of it, i can just spawn round(6.28*r) MOPixels with infinite sharpness and HitsMO=1 on almost the edge of fireball and accelerate them by applying force from the center. And after a tick or two i should scan radius for MOPixels and delele the all (including gibs, loose terrain and so on).

So, for radius 1000 i have to spawn upto 6280 particles per tick.


Thu May 29, 2014 9:40 pm
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Wed Sep 05, 2007 4:14 am
Posts: 3966
Location: Canadida
Reply with quote
Post Re: Control over MOPixels
What you would do is destroy everything forever, because infinite sharpness, and thousands of particles (begetting many thousands more) would not only destroy the frame rate, but also not have the intended effect that you are looking for. At best, you'd completely obliterate the map, a la map wipe; at worst, you'll be left with a strange mess that is more insubstantial than oaths of office, that no one would really like.

Also, actively updating the velocity of a particle is annoying, tedious, and laggy business on the scale you are thinking of, but hey at least you can simply overwrite an entity's velocity, no need to make them accelerate.


Fri May 30, 2014 8:54 am
Profile
User avatar

Joined: Sun Jan 28, 2007 10:32 pm
Posts: 1609
Location: UK
Reply with quote
Post Re: Control over MOPixels
In a slightly less fanciful way; there is a fairly low cap on the number of active MOs/objects in the game right now. This is known as the 'MOID Limit' and is, I think, somewhere in the region of 255? I think anything with "HitsMOs = 1" counts against this limit.

If there are too many active MOs, the game inevitably starts deleting existing ones to make room, as I recall. Sometimes, 'deleting' includes 'gibbing spectacularly'.

Now, if you want to quickly clear out a large, specific radius area, what you could try doing is spawning a single massive object that will collide with (and thus eradicate) all terrain underneath it. But this will do really weird stuff when actor collisions are involved if you don't time their deletion properly. It's hacky but it would probably work better than spawning vast quantities of particles.


Fri May 30, 2014 2:32 pm
Profile YIM

Joined: Mon May 26, 2014 4:10 pm
Posts: 9
Reply with quote
Post Re: Control over MOPixels
Quote:
What you would do is destroy everything forever, because infinite sharpness, and thousands of particles (begetting many thousands more) would not only destroy the frame rate, but also not have the intended effect that you are looking for. At best, you'd completely obliterate the map, a la map wipe; at worst, you'll be left with a strange mess that is more insubstantial than oaths of office, that no one would really like.

Don't forget that's just a task to learn internal Lua interface and INI. I don't think i will make a mod with that bomb or something.
In other hand that task is pretty hard to complete almost everywhere, so, it may be considered as "coding challenge".

Quote:
In a slightly less fanciful way; there is a fairly low cap on the number of active MOs/objects in the game right now. This is known as the 'MOID Limit' and is, I think, somewhere in the region of 255? I think anything with "HitsMOs = 1" counts against this limit.

It doesn't seems like MOPixels have any value to this limit. They never are counted by MM:GetMOIDCount() and thus they don't have (low) limit.

Here's a screenshot where i spawn 12560 invisible MOPixels without trace and color with 0 mass and 999999999 sharpness. Two situation - without knocking tons of terrain:
Image
It lags, but that's not the slideshow yet.

Image
At this moment it started to lag like hell because of MOPixels of loose terrain. But, take this in mind - my bomb will _delete_ those pixels as they appear so, it shouldn't lag too much.


Moreover, i can evade spawning tons of MOPixels every tick, but that's kinda complicated. Instead of deleting and spawning new MOPixels, i can just _add_ new MOPixels to circle
In this case formula starts to be even worse: r>0; count = round(6.28*r) - round(6.28*(r-1)). And put these new particles in their place and accelerate them in same manner.
So, even for radius 1000 i have to spawn upto:
6280 - 6273 = SEVEN particles.
7 particles a tick is really fast spawning, but tricky. It's also easy to find that i have to spawn 6-7 pixels a tick no matter of radius. So...
Quote:
Also, actively updating the velocity of a particle is annoying, tedious, and laggy business on the scale you are thinking of, but hey at least you can simply overwrite an entity's velocity, no need to make them accelerate.

-problem is evaded.


By the way, here's another, but strange problem - these particles even with mass = 0 and AirResistance = 0 and AirThreshold = 0 affected by gravity. I should somehow evade this problem because it makes non-ideal circle and doesn't destroy terrain ideally.


Fri May 30, 2014 4:03 pm
Profile
User avatar

Joined: Sun Jan 28, 2007 10:32 pm
Posts: 1609
Location: UK
Reply with quote
Post Re: Control over MOPixels
Interesting. Anyway, for gravity, you want GlobalAccScalar, which can be set on almost any MO the same way as Mass. Setting this to 1 means normal gravity behaviour; setting it to 0 means it's completely unhindered/unaffected by gravity.


Fri May 30, 2014 4:29 pm
Profile YIM
Data Realms Elite
Data Realms Elite
User avatar

Joined: Wed Sep 05, 2007 4:14 am
Posts: 3966
Location: Canadida
Reply with quote
Post Re: Control over MOPixels
Arcalane wrote:
In a slightly less fanciful way; there is a fairly low cap on the number of active MOs/objects in the game right now. This is known as the 'MOID Limit' and is, I think, somewhere in the region of 255? I think anything with "HitsMOs = 1" counts against this limit. I tihnk the limit deals more with more complicated things... anything within the general class of MOSprite

If there are too many active MOs, the game inevitably starts deleting existing ones to make room, as I recall. Sometimes, 'deleting' includes 'gibbing spectacularly'. Mostly it's collision errors, which do tend towards gibbing, and erroneous wounds from the otherside of creation

Now, if you want to quickly clear out a large, specific radius area, what you could try doing is spawning a single massive object that will collide with (and thus eradicate) all terrain underneath it. But this will do really weird stuff when actor collisions are involved if you don't time their deletion properly. It's hacky but it would probably work better than spawning vast quantities of particles. Cavecricket actually suggested something better, and less glitchy.


CaveCricket48 wrote:
You can cleanly remove actors by setting them to ToDelete = true. Like,
Code:
actor.ToDelete = true;

To clear terrain, you'll need to position an MO to where you want terrain to be removed, and then do
Code:
yourMO:EraseFromTerrain();


Fri May 30, 2014 8:58 pm
Profile

Joined: Mon May 26, 2014 4:10 pm
Posts: 9
Reply with quote
Post Re: Control over MOPixels
Hm...
Quote:
To clear terrain, you'll need to position an MO to where you want terrain to be removed, and then do

Can i use MO.scale to do that?


Fri May 30, 2014 10:43 pm
Profile

Joined: Mon May 26, 2014 4:10 pm
Posts: 9
Reply with quote
Post Re: Control over MOPixels
Image

Using EraseFromTerrain works, but two problems:
1. Scaling MOSRotating is REALLY lagging.
2. It deletes square, not circle.


Sat May 31, 2014 12:07 am
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post Re: Control over MOPixels
Use an MO shaped like a circle.


Also, it's MOs that have GetsHitByMOs = true that count towards the MOID limit. Not HitsMOs.


Sat May 31, 2014 2:09 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 22 posts ]  Go to page 1, 2  Next

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.057s | 14 Queries | GZIP : Off ]