Page 1 of 1

First attempt at a design for the new CrystalBlend UI

Posted: Tue Oct 18, 2005 11:33 am
by jorrit
I did a first attempt at a design for the new CrystalBlend UI based on
the state-scenario in my previous mail. You can download the PDF here:

http://www.crystalspace3d.org/CrystalBl ... oposal.pdf

A bit of explanation. There are basically two editing modes here.
First you have the screen where you can edit 'quests' (terminology can
be changed, don't worry too much about that). A quest is basically a
state machine. In this example I have a quest for a door that can open
('OpenableDoor'). This quest has two inputs: 'button' and 'timeout'.
The 'button' input is the object that will respond to clicks in order
to open and close the door. The 'timeout' input is the timeout value
to use for automatically closing the door. The quest also has four
states: Closed, Opening, Open, and Closing. Every state is linked to
one or more triggers. In this example I use three kinds of triggers:
  • - OnClick: when an object is clicked.
    - SequenceFinish: when an animation sequence finishes.
    - TimeOut: when a timeout occurs.
More triggers are of course possible. In a way triggers represent the
current sensor system in Blender.
Every trigger is linked to one or more rewards. In this example I use
the following actuators:
  • - StartSequence: start an animation sequence.
    - NewState: switch the quest to a different state.
More rewards are possible. Rewards are equivalent to actuators right now.

Then you have the other mode where you can edit entities. Entities are
a bit like logic bricks (we can also call them that way if that is
preferred). A very important difference between current GameBlender
logic and this system is that the logic (i.e. triggers+rewards) is
disconnected from the actual entity so that you can reuse the same
logic for different entities. i.e. if you have multiple doors you
don't have to completely clone the entire sensor/actuator block all
the time (and have a lot of work if you need to change something).

In the entity editor you can see how the entity has three different
sections: 'properties', 'mesh', and 'quest'. More sections are
possible here if needed.

The big advantage (in my view) of this system is that it is a generic
and powerful system that is not hard to use. Also it maps VERY well to
CEL but it isn't actually very tied to it. i.e. this system can very
well be implemented on top of another 3D engine/Game logic kit.

So what do you think?

Greetings,

Posted: Wed Oct 19, 2005 5:00 pm
by madcello
Just a couple of questions:

Where does Python fit in the chain?

Can a State have more than 2 values?

Could your door quest function like this?

State closed (0)
State opened (1)
State transition, where transition(0 or closed) is opening and transition(1) is closing (just an example).

Posted: Thu Oct 20, 2005 11:07 am
by joeri
I think the sequence "opening door" should be played back in state "opening door" and not in state "closed door".
So If I would jump to the state "opening door" the door would open, and not give the signal "open door" and then jump to the "opening door" state.

The state should not only keep in memory what state it is in, but also do it.

I tell you why:

A character is in state "rest"
Now something happens and it wants to go into state "Jump" then I set it in state "Jump" and it jumps... Now if something else happens it might want to go into state "Die". I put it in state "die"and then the objects dies.

In your system I would need a Do Die, Do Jump, Do Something in every state because I can go from each state to another state.

Posted: Thu Oct 20, 2005 11:14 am
by joeri
I would prefer less states and sub state levels

OnEnter
OnLoop
OnLeave
TimeOut

-------------- State: Rest
OnEnter:
Start Sequence: Ipo.001
Play Sound "Oef.aiff"

OnLoop:
Start Sequence: Ipo.001
Play Sound: "Duh.aiff"

OnLeave:
Set property: MyVal= 4

TimeOut: 30

Trigger: SequenceEnd; OnLoop
Trigger: Bullethit; StateChange("Die")
Trigger: TimeOut; StateChange("Bored")
--------------

I hope this makes sense.

Posted: Thu Oct 20, 2005 11:18 am
by jorrit
madcello wrote:Just a couple of questions:

Where does Python fit in the chain?
The idea with the new GameEngine is to avoid having to go to Python as much as you have to do it right now. Of course it will be possible to integrate Python too. At this moment I haven't yet decided how that will be though. Probably as a behaviour in the CEL concept. i.e. you attach the python script to the entity and it will react to messages from the property classes.
Can a State have more than 2 values?
No. That wouldn't make sense in a state machine.
Could your door quest function like this?

State closed (0)
State opened (1)
State transition, where transition(0 or closed) is opening and transition(1) is closing (just an example).
Possibly.

Greetings,

Posted: Thu Oct 20, 2005 11:19 am
by jorrit
joeri wrote:I think the sequence "opening door" should be played back in state "opening door" and not in state "closed door".
So If I would jump to the state "opening door" the door would open, and not give the signal "open door" and then jump to the "opening door" state.

The state should not only keep in memory what state it is in, but also do it.
That is exactly what happens. I don't really understand what you mean here? If you switch to some state it will have immediate effect.
I tell you why:

A character is in state "rest"
Now something happens and it wants to go into state "Jump" then I set it in state "Jump" and it jumps... Now if something else happens it might want to go into state "Die". I put it in state "die"and then the objects dies.

In your system I would need a Do Die, Do Jump, Do Something in every state because I can go from each state to another state.
Sorry but I'm not following you. Can you clarify what you mean?

Greetings,

Posted: Thu Oct 20, 2005 11:20 am
by jorrit
joeri wrote:I would prefer less states and sub state levels

OnEnter
OnLoop
OnLeave
TimeOut

-------------- State: Rest
OnEnter:
Start Sequence: Ipo.001
Play Sound "Oef.aiff"

OnLoop:
Start Sequence: Ipo.001
Play Sound: "Duh.aiff"

OnLeave:
Set property: MyVal= 4

TimeOut: 30

Trigger: SequenceEnd; OnLoop
Trigger: Bullethit; StateChange("Die")
Trigger: TimeOut; StateChange("Bored")
--------------

I hope this makes sense.
I'm afraid not :-/

Greetings,

Posted: Thu Oct 20, 2005 11:33 am
by joeri
Image

More clean (less beatiful picture).
The entry of the state starts the animations, so you can jumping into the state will give you the reward, not leaving another state.

For a door, who cares, but for multiple state jumping this is much nicer.
It makes more debug sense to: the seqCloseDoor is in the state Closing.
In your system the seqCloseDoor is in the state open.

Now what if you would want to add state "Door explodes"?
You would need to add this in every state:
Trigger: hit, reward1: Startseq :Explode. reward2: State:Explode.
In this system I would only need to add Trigger: hit, reward: State:Explode. And the entry of state Explode would reward the startseq.

Posted: Thu Oct 20, 2005 11:35 am
by jorrit
joeri wrote:More clean (less beatiful picture).
The entry of the state starts the animations, so you can jumping into the state will give you the reward, not leaving another state.
Ah I see now. Yes something like that is possible. I was planning to add that to the CEL quest manager anyway so we can easily do it like that too.

Greetings,

Posted: Thu Oct 20, 2005 11:40 am
by joeri
Did you see this thing ?
http://www.blender.org/documentation/lo ... oposal.pdf
Start at page 51,...

Posted: Thu Oct 20, 2005 11:42 am
by jorrit
joeri wrote:Did you see this thing ?
http://www.blender.org/documentation/lo ... oposal.pdf
Start at page 51,...
Yes, I'm still reading it though.

Greetings,

Posted: Thu Oct 20, 2005 11:48 am
by joeri
cool

Posted: Mon Nov 28, 2005 7:15 pm
by dotblend

Posted: Mon Nov 28, 2005 7:19 pm
by dotblend
i personallly think the game engine should be more modulair, now it's to clumsy... i have a big job for the game enigine, but i simply cant make it happen with the current options...