2 registered members (Akow, tomaslolo),
1,536
guests, and 12
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Unity 3 announced
[Re: Pappenheimer]
#315870
03/19/10 18:12
03/19/10 18:12
|
Joined: May 2005
Posts: 2,713 Lübeck
Slin
Expert
|
Expert
Joined: May 2005
Posts: 2,713
Lübeck
|
Well, the often used alternative to gamestudios while loops with wait(1), which also Unity uses are event functions. in unity one is for example called Start. That is called in the moment the object is created. Then there is the update function, which is called each frame, directly before rendering And then there of course are some other events as well like mouseDown or what ever it is called, which is executed in the moment a mousebutton is pressed above the object and there of course are also other functions like that. It is actually very easy. These function are always called in the same order of course. A bit more tricky in unity is in my opinion the way you can access other objects. But also that works fine if you once found out how to do it. What I like is that the code is in general very modular and quite clean, the disadvantage of the object oriented design are on the other hand the very long code lines which tend to be a bit messy. I for example have a script instance which has the pointer to another scripts instance which has the gameobject it handles as pointer, which has the transform member, which holds the position, which holds the x, y and z components. The result is something like this: scrobj1.scrobj2.gameObject.transform.position.x, but well this is an extreme case of course, just to demonstrate what I mean.
|
|
|
Re: Unity 3 announced
[Re: Pappenheimer]
#315872
03/19/10 18:30
03/19/10 18:30
|
Joined: Mar 2006
Posts: 3,538 WA, Australia
JibbSmart
Expert
|
Expert
Joined: Mar 2006
Posts: 3,538
WA, Australia
|
It appears to use a similar approach to lite-C's EVENT_FRAME, if I'm not mistaken. Of course, lite-C's frame event could more easily get quite convoluted since the same event/function will be used with any other events that the entity detects (EVENT_IMPACT and so on).
Unity appears to separate these, and it looks quite nice.
Jibb
EDIT: Okay, thanks for the explanation, Slin. (I had the reply window open for too long).
Last edited by JulzMighty; 03/19/10 18:31.
Formerly known as JulzMighty. I made KarBOOM!
|
|
|
Re: Unity 3 announced
[Re: Pappenheimer]
#315873
03/19/10 18:36
03/19/10 18:36
|
Joined: Oct 2007
Posts: 5,210 Ä°stanbul, Turkey
Quad
Senior Expert
|
Senior Expert
Joined: Oct 2007
Posts: 5,210
Ä°stanbul, Turkey
|
we are using while loops for repating same task in all frames(while(1) ... wait(1)) in Unity, there are functions that are automatically called every frame, so you are already writing the inside of the while.
3333333333
|
|
|
Re: Unity 3 announced
[Re: Slin]
#315874
03/19/10 18:39
03/19/10 18:39
|
Joined: Sep 2003
Posts: 5,900 Bielefeld, Germany
Pappenheimer
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
|
Ah, great, that explains the start() and update() in the examples from Captain Kiyaku's explanations. Now, I'm getting shameless : How does one entity create another? F.i. a dying entity leaves a health pack... (Hope, you don't mind my questions, for I don't have the time to take a closer look at Unity now, but I'm veeery curious. It is more a sort of entertainment, since there's not much happening at these forums at the moment and I enjoy your company... So, please don't feel forced to answer!)
|
|
|
Re: Unity 3 announced
[Re: Quad]
#315875
03/19/10 18:41
03/19/10 18:41
|
Joined: Mar 2006
Posts: 3,538 WA, Australia
JibbSmart
Expert
|
Expert
Joined: Mar 2006
Posts: 3,538
WA, Australia
|
we are using while loops for repating same task in all frames(while(1) ... wait(1)) in Unity, there are functions that are automatically called every frame, so you are already writing the inside of the while. Well there's more to it than that. The special thing about wait(1) in A7 is that function execution continues from that spot the next frame, with all local variables preserved. Assuming Unity lets you extend its entity objects by adding your own variables to the objects themselves (which I'm sure it does, but I just don't know), this wouldn't be an issue anyway, I guess. Jibb
Formerly known as JulzMighty. I made KarBOOM!
|
|
|
Re: Unity 3 announced
[Re: JibbSmart]
#315876
03/19/10 18:44
03/19/10 18:44
|
Joined: Oct 2007
Posts: 5,210 Ä°stanbul, Turkey
Quad
Senior Expert
|
Senior Expert
Joined: Oct 2007
Posts: 5,210
Ä°stanbul, Turkey
|
there is a function smiliar to ent_create. Instantiate(object/prefab, position, rotation);
edit: object/prefab can have several attached scripts to itself.
Last edited by Quadraxas; 03/19/10 18:45.
3333333333
|
|
|
Re: Unity 3 announced
[Re: Slin]
#315886
03/19/10 19:13
03/19/10 19:13
|
Joined: May 2002
Posts: 7,441
ventilator
Senior Expert
|
Senior Expert
Joined: May 2002
Posts: 7,441
|
|
|
|
Re: Unity 3 announced
[Re: ventilator]
#315904
03/19/10 22:46
03/19/10 22:46
|
Joined: Sep 2003
Posts: 5,900 Bielefeld, Germany
Pappenheimer
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
|
Thanks for your answers so far! The explanations from the link look quite clear. Can't wait to read through the manual and take the first steps of scripting when I have time.
|
|
|
Re: Unity 3 announced
[Re: Pappenheimer]
#315932
03/20/10 10:00
03/20/10 10:00
|
Joined: Nov 2004
Posts: 7,121 Potsdam, Brandenburg, Germany
Machinery_Frank
Senior Expert
|
Senior Expert
Joined: Nov 2004
Posts: 7,121
Potsdam, Brandenburg, Germany
|
I find this all very exciting. I plan to do some more testing soon to compare the power and indoor scene management of different game engines. I currently finished a new sci-fi pack and started to work on a few models / indoors for the next pack. Here is a first test in the C4 engine: more images here: http://www.terathon.com/forums/viewtopic.php?f=30&p=81005#p81002I am really interested to see how other technology performs, when I add lights, shadows and shaders in a similar way and how I can optimize culling (zones and portals). Since I have a license of Torque3D, I will do a test there also. I own C4 and I probably will get Unity 3 soon to better support our Unity customers. But for testing A7 I probably need some help.
Models, Textures and Games from Dexsoft
|
|
|
|