wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Resources > Code Resources > Systems
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 12-01-2007, 08:24 PM   #1
HINDYhat
User
 
HINDYhat's Avatar
 
Join Date: Aug 2007
Posts: 225

Submissions (2)

HINDYhat will become famous soon enough (48)HINDYhat will become famous soon enough (48)

Default SEE : Simple Entity Engine

NOTE: You have been redirected in order for our attachments to be made available to you. This will only last two minutes; these measures where taken to avoid hotlinking and bandwidth theft.
To avoid these restrictions Log in or Register

SIMPLE ENTITY ENGINE
********************************


Version 2.4

The third system of its kind created by me, this one will hopefully be more succesful and will live up to my expectations. The two others were Simple Particle System, and then Simple Particle System Mark II. The first of the three was buggy, very slow, and extremely inaccurate. The second used procedural-style coding, which people didn't seem to appreciate. I finally created this: SEE - Simple Entity Engine. It uses object-oriented style scripting, which makes things alot easier to read and understand. I've worked a lot on getting this system to where I want it to be.

Please only report bugs or give criticism RELATED to this system!
This system requires JassNewGenPack for the use of vJass syntax!
This system uses UnitUserData!


Quote:
Features:
  • Easy to use, easy to read layout.
  • Efficient and fast system.
  • 'Realistic' bouncing off other entities and the ground.
  • Spherical collisions between entities.
  • Easy to create custom entity types.
  • Mass and volume play important roles in entity behaviors.
  • Documented just for you! :D

Credits go to HINDYhat for the creation of this system.

Thanks to Earth-Fury for helping me a lot and teaching me how to use object-oriented programming. Also thanks to him for coming up with this system's neat name, SEE: Simple Entity Engine.
------------------------
Thanks to PurplePoot for teaching me some things in Jass.
------------------------
Thanks to moyack for helping me on a nagging collision problem, and for being nice and helpful. :D
------------------------
Many thanks to grim001 for helping with a couple of bugs in collision detection.
------------------------
Thanks to anyone and everyone who might use this system in a map of theirs.


And now the code:
Expand SEE core:
Expand SEE entityData:

Additional triggers, such as the plugin triggers, can be found inside the map.

********************************

And now, documentation:
Implementing

*******************************************
****** ~ Implementing instructions ~ ******
*******************************************

Follow these steps to succesfully implement this
system into your map.

1. Import the "dummy.mdx" model from this map to yours,
and be sure to keep the same model path for it.

2. Copy the dummy unit 'e000' from this map to yours.
You can change the rawcode if you want, you'll just
have to change another value later in the code.

3. Copy these triggers into your map:
"SEEentityData"
"SEEcore"
"SEEdatalib"
"SEEplugin"
"SEEheight"

4. Go to the top of the "SEEcore" trigger, and toggle the
constants of the trigger to fit your needs (if you
changed the rawcode of the dummy unit before,
you have to set it to the changed rawcode now. The constant
you have to change is called "DUMMY_ID".

5. Delete everything in between the library delimiters
in the "SEEdatalib" trigger.

6. Run your map once with SEEheight enabled. Follow the
on-screen instructions.

7. Have fun making your maps with this system! :D

8. And for GOD's sake, read the damned documentation!!!



Changelog

*******************************************
****** ~ Change Log ~ ******
*******************************************

Simple Entity Engine. Version 2.4

--- 2.4 ---
Rewrote ground collision detection script. It's now feckin great.
Replaced the debug messages to use SCOPE_PREFIX.
Added the SEEheight library. (neat idea, shamelessly taken from grim001)
Made SEEcore_FPS a constant again.
Fixed some stuff in the implementing instructions.
Removed the selection circle from the dummy unit.

--- 2.3 ----
Changed friction calculations once again. Now seems much better.
Now keeps default scale on entity.createFromUnit if no scale is specified.
Removed health bars on non-locusted entities from entity.create.
projectTowardsPointSpeed now works as desired.
Entity collisions are now prevented from being calculated twice.
Fixed some bugs in the demo.
onCollision is now executed after collision resolution.
Fixed a wrong entity collision calculation.
Added an extra term in terrain collision detection for better precision.
Added the SAMPLE_RADIUS constant for terrain collisions.
Entities can now slide on the ground. Added a THRESHOLD_VEL constant for this.
Added the setEntityFlyHeight method.
Added the entity.createAsUnit method.
Fixed an issue with resting non-affected entities.
Removed a useless parameter for the removeSpringConstraint method.
Added the removeHealthBar method.
Added a "Constant List" documentation page.
Moved the onLoop call in SEEcore's main function (fixed a bug in resting non-affected entities).
Added a new demo.

--- 2.2 ---
Added projectToPointSpeedEx and projectToPointTimedEx.
Added projectTowardsPointSpeed.
Added enumEntitiesOfPlayer/InRect/OfType.
Added createFromGroup and createFromUnitType.
Rewrote the applyTimedLife method into something much simpler.
Fixed an issue with rest on non-affected entities.
Improved collision detection (now there are two integrated methods)
Removed some useless operations.
Added COLLISION_VEL and THRESHOLD_VEL constants.
Removed some lame parts about the entity struct.
Added the appropriate scale for createFromUnit.
Added a new demo.
Fixed some parts about the documentation.
Most stuff that I've forgotten.

--- 2.1 ---
Fixed friction calculations. (1.0 friction is now no motion, 0.0 friction is no friction at all)
Added an enum method.
Added a new projectToPointSpeed which takes in account gravity.
Made a new demo. (Credits to WILLTHEALMIGHTY for the nuke effect)
Probably added more stuff but I don't remember.

--- 2.0 ---
Remade the whole thing from scratch.
Collision is now time-velocity based.
New collision resolution technique.
Added air drag.
Added spring constraints.
TONS of optimization.
Added a few onX methods to entityData.
COMPLETE makeover on the syntax.
Made a new demo.
Probably many more changes that I forgot about.
--- 2.0.1 ---
Fixed a bug in the demo.

--- 1.2 ---
Added a Bounceable property.
Inlined the GroundBounce function.
Inlined (and optimized) the CollisionBounce function.
Replaced Static entities with an Affected state.
Added a Rest tally for more precise resting states.
Collision optimization.
Added Offsetx/y/z coordinates.
Replaced the crappy Projectile plugin with a cool Vehicle plugin.
Added documentation.
Smaller fixes...

--- 1.1 ---
Patched up collision detection and prevention.
Optimized the GroundBounce function (just a little bit).
Fixed an Entity removal problem (double free).
Removed the use of TriggerAddAction. The system now uses TriggerAddCondition.
Fixed an onEvent method problem with the CreateEntity method.
Added a little debug function.
A couple of smaller bug fixes...

--- 1.0 ---
Public release of the system.

*******************************************
****** ~ Previous Systems ~ ******
*******************************************
- Simple Particle System (slow, buggy and bad)
- Simple Particle System Mark II (used procedural sloppy coding)



Expand Constant List:

Expand Member List:

Expand Method List:

********************************


Finally, an example on how to use this system (A MUCH more elaborate example is included in the attached map) :
Expand Example:
Attached Images
File Type: jpg SEEImage.jpg (49.3 KB, 550 views)
Attached Files
File Type: w3x SEE-Simple Entity Engine 2.4.w3x (58.4 KB, 295 views)
__________________
Quote:
Originally Posted by Chat Room
[19-17-58] Da)sniper: not go blistic because ur a raciest vs all guiers

Last edited by HINDYhat : 10-23-2009 at 07:41 PM.
HINDYhat is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 12-02-2007, 12:30 AM   #2
Tide-Arc Ephemera
Overdoses result in death
 
Tide-Arc Ephemera's Avatar
 
Join Date: Jan 2007
Posts: 2,365

Submissions (3)

Tide-Arc Ephemera is a jewel in the rough (206)Tide-Arc Ephemera is a jewel in the rough (206)Tide-Arc Ephemera is a jewel in the rough (206)

Default

Please mention the vJass requirement... somewhere which is obvious...
__________________
Before asking for help with triggers... read this and check your trigger!

If you're having troubles getting help on WC3C or anywhere at all, please have a look at...
The WRONG way to ask for help and The CORRECT way to ask for help.

Quote:
Originally Posted by Alevice
You may never stop our bioweapon! We mexicans shall rule the third world! Mwahahahahahahaha!
Please acknowledge that I use Mac and avoid suggesting vJass and other tools that don't work on it. Thank you.
Tide-Arc Ephemera is offline   Reply With Quote
Old 12-02-2007, 12:35 AM   #3
HINDYhat
User
 
HINDYhat's Avatar
 
Join Date: Aug 2007
Posts: 225

Submissions (2)

HINDYhat will become famous soon enough (48)HINDYhat will become famous soon enough (48)

Default

Whoops, sorry 'bout that.
__________________
Quote:
Originally Posted by Chat Room
[19-17-58] Da)sniper: not go blistic because ur a raciest vs all guiers
HINDYhat is offline   Reply With Quote
Old 12-02-2007, 12:50 AM   #4
cohadar
master of fugue
 
cohadar's Avatar
 
Join Date: Jun 2007
Posts: 2,453

Submissions (5)

cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)

Default

Well I must say this really looks promising.
It is much better coded than before, and what is most important it is modular!

Of course we will need to inspect his in detail
__________________
Omg database crash deleted my signature, as a side effect this immensely improved wc3c.
cohadar is offline   Reply With Quote
Old 12-02-2007, 01:02 AM   #5
HINDYhat
User
 
HINDYhat's Avatar
 
Join Date: Aug 2007
Posts: 225

Submissions (2)

HINDYhat will become famous soon enough (48)HINDYhat will become famous soon enough (48)

Default

Well I'm thinking of replacing all of my use of triggeractions with triggerconditions because of this : http://66.166.149.149/showthread.php?t=93797

Would that be a good idea?
__________________
Quote:
Originally Posted by Chat Room
[19-17-58] Da)sniper: not go blistic because ur a raciest vs all guiers
HINDYhat is offline   Reply With Quote
Old 12-02-2007, 02:00 AM   #6
moyack
Evil Emoticon
 
moyack's Avatar


Respected User
Project Leader: PoC
 
Join Date: Jan 2006
Posts: 3,279

Submissions (17)

moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)

AI Tournament #2 - 2nd PlaceHero Contest - Second place

Send a message via MSN to moyack
Default

Quote:
Originally Posted by HINDYhat
Well I'm thinking of replacing all of my use of triggeractions with triggerconditions because of this : http://66.166.149.149/showthread.php?t=93797

Would that be a good idea?
Yes, it's not bad, but if you can avoid the trigger usage, better. Anyways, it's up to the application.

One thing that I've seen is that you're creating timers to manage each projectile, IMO, it's a very bad approach, it's like saying that the time framework is different according to the object. Manage ALL your movement with only ONE timer.
moyack is offline   Reply With Quote
Old 12-02-2007, 02:07 AM   #7
HINDYhat
User
 
HINDYhat's Avatar
 
Join Date: Aug 2007
Posts: 225

Submissions (2)

HINDYhat will become famous soon enough (48)HINDYhat will become famous soon enough (48)

Default

Yeah, that's only for the projectile extension.

I suppose I made that really quickly. I could work harder on it, and make it actually a useful system.

As for now, I'm still fixing up collisions... they're really being nasty.
__________________
Quote:
Originally Posted by Chat Room
[19-17-58] Da)sniper: not go blistic because ur a raciest vs all guiers
HINDYhat is offline   Reply With Quote
Old 12-03-2007, 01:10 AM   #8
grim001
requires vJass
 
grim001's Avatar


Code Moderator
 
Join Date: Nov 2006
Posts: 1,540

Submissions (10)

grim001 is just really nice (277)grim001 is just really nice (277)

Send a message via AIM to grim001
Default

Good to see that you use my GetTerrainNormal method...

You have a lot of work left to do on collisions... personally I would say that you should stop caring about those since they are impossible to get right unless you copy my system exactly. It's too much work for anyone who's not insane. That's just a fact.

Overall, this is definitely a step in the right direction compared to previous engines, and it looks kind of similar to mine as far as overall design and the user-end goes.
grim001 is offline   Reply With Quote
Old 12-03-2007, 08:45 AM   #9
MaD[Lion]
MaD Da ViNci
 
MaD[Lion]'s Avatar


Respected User
 
Join Date: Apr 2003
Posts: 1,699

Submissions (10)

MaD[Lion] is a jewel in the rough (225)MaD[Lion] is a jewel in the rough (225)MaD[Lion] is a jewel in the rough (225)MaD[Lion] is a jewel in the rough (225)

Default

grim there is something with ur object vs object collision. u use 1 group for each object for preventing double check. but wat about use only 1 global group, and for each object tat u have checked collision, add it to this group.
Everything in this group wont be checked with anymore.
And after all the loop, just clear this group.
__________________
Current Projects:
MaDOS (outdated)System for object movements & effects - NEW VERSION IS UNDER W.I.P
Cinematic SystemSystem for making better cinematics and with fancy effects
Timing SystemTiming system that simulates the usage of PolledWait just with 0.01 accuracy
MaD[Lion] is offline   Reply With Quote
Old 12-03-2007, 09:03 AM   #10
grim001
requires vJass
 
grim001's Avatar


Code Moderator
 
Join Date: Nov 2006
Posts: 1,540

Submissions (10)

grim001 is just really nice (277)grim001 is just really nice (277)

Send a message via AIM to grim001
Default

That won't work... if A collides with B it doesn't mean C won't collide with A. And it's kind of off topic in this thread too.
grim001 is offline   Reply With Quote
Old 12-03-2007, 09:46 AM   #11
cohadar
master of fugue
 
cohadar's Avatar
 
Join Date: Jun 2007
Posts: 2,453

Submissions (5)

cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)cohadar is just really nice (250)

Default

Quote:
Originally Posted by grim001
Good to see that you use my GetTerrainNormal method...

Strange, I always thought Anitarf made that.
__________________
Omg database crash deleted my signature, as a side effect this immensely improved wc3c.
cohadar is offline   Reply With Quote
Old 12-03-2007, 12:46 PM   #12
HINDYhat
User
 
HINDYhat's Avatar
 
Join Date: Aug 2007
Posts: 225

Submissions (2)

HINDYhat will become famous soon enough (48)HINDYhat will become famous soon enough (48)

Default

Earth-Fury has helped me alot, and gave me the idea of working with two temp locations and inlining the cross product.

I've recently gotten collisions to work a little bit nicer.

Anitarf made the GetTerrainNormal shiz in his Vector Functions, but grim just inlined it. It's not really a new method, I think, just a faster one.

Sorry if I copied your system too much... just that logically, spherical collisions is the way to go, and your system was awesome when I tested it. I guess I was just trying to make something good.
__________________
Quote:
Originally Posted by Chat Room
[19-17-58] Da)sniper: not go blistic because ur a raciest vs all guiers
HINDYhat is offline   Reply With Quote
Old 12-03-2007, 05:43 PM   #13
HINDYhat
User
 
HINDYhat's Avatar
 
Join Date: Aug 2007
Posts: 225

Submissions (2)

HINDYhat will become famous soon enough (48)HINDYhat will become famous soon enough (48)

Default

Updated the system. Collision safety shiz now works and can be changed (it's a constant).

Here's the changelog for 1.1:
Quote:
Originally Posted by Changelog
--- 1.1 ---
Patched up collision detection and prevention.
Optimized the GroundBounce function (just a little bit).
Fixed an Entity removal problem (double free).
Removed the use of TriggerAddAction. The system now uses TriggerAddCondition.
Fixed an onEvent method problem with the CreateEntity method.
Added a little debug function.
A couple of smaller bug fixes...
__________________
Quote:
Originally Posted by Chat Room
[19-17-58] Da)sniper: not go blistic because ur a raciest vs all guiers
HINDYhat is offline   Reply With Quote
Old 12-03-2007, 06:03 PM   #14
Pyrogasm
Lackadaisically Absent.
 
Pyrogasm's Avatar


Respected User
 
Join Date: Sep 2006
Posts: 4,523

Submissions (9)

Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)

Hero Contest - Fourth place

Send a message via ICQ to Pyrogasm Send a message via AIM to Pyrogasm Send a message via MSN to Pyrogasm Send a message via Yahoo to Pyrogasm
Default

I looked briefly at your code and noticed that you're using the EVENT_UNIT_SELECTED event. This has been known to be a very late-running event that doesn't fire at the proper time.

I don't know what you'll want to do about that, but I thought I should point it out...
__________________
Quote:
Originally posted by Rising_Dusk
Your spells are mostly ignored because they are not very cool so we aren't very excited to review/approve them, but you are incredibly persistent and won't give us an excuse to graveyard it. That is generally what results in a resource being ignored for a long time.

The Spell Request Thread Done for, unless someone else wants to revive it...
It lasted a damn long time.

Please; Ask for Help Appropriately














Quote:
Originally posted by Kyrbi0
Huh. Almost makes me wish I had a girlfriend, to take advantage of today (wait, no, that's not what I meant... I mean, take advantage of the fact that it is international women's day... gah, never mind).
Quote:
Originally posted by Pyrogasm
Rome may not have been built in a day, but the Romans sure as hell didn't say "look at this great city we built guys!" when they had nothing more than a bit of stone and some cottages.
Pyrogasm is offline   Reply With Quote
Old 12-03-2007, 06:06 PM   #15
HINDYhat
User
 
HINDYhat's Avatar
 
Join Date: Aug 2007
Posts: 225

Submissions (2)

HINDYhat will become famous soon enough (48)HINDYhat will become famous soon enough (48)

Default

Well it's to detect when an entity is selected (with the onSelect method). I could add an IsUnitSelected checker in the main loop, but that would be slow...

Besides, it's one of the onEvent methods that people would use the least. I don't think pinpoint precision is necessary in this case. But if you really want me to do something about it... meh.
__________________
Quote:
Originally Posted by Chat Room
[19-17-58] Da)sniper: not go blistic because ur a raciest vs all guiers
HINDYhat is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 02:11 PM.


Affiliates
The Hubb The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2019, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services