Jump to content

Photo

Zelda Modern


  • Please log in to reply
411 replies to this topic

#181 Koopa

Koopa

    The child behind the turtle

  • Members
  • Location:Switzerland

Posted 30 June 2010 - 11:17 AM

Gleeok: I hadn't even thought as far as integrating events with scripting but now you say it, your suggestion sounds like a very good way to go.

I envisaged events mainly for those who want a point-and-click based system to do easy things and that can help them graphically like highlighting all "trigger" tiles red and "action" ones blue on a screen (possibly even with arrows that have an icon over them to show the type of event - so you'd see a bush with a red highlight and a "fire" icon, a ground tile with a blue highlight and an arrow from the bush to the ground tile. Possibly you could even drag the arrow to change the target tile. This is about the easiest thing to use I could imagine, but its drawbacks are it's harder to develop and only works for a small subset of the things you could script. But if we get something like this done, integrating this with scripting is going to be easier than making the events in the first place.

I could even think of setting up an event in the editor as above and then pressing an optional "convert to script" button which allows you to modify the event if the event system is not powerful enough for you or just to learn a bit of scripting. But that's rather a "when we have lots of spare time" idea.

For the file format, I suggest doing what OpenOffice does - the main file is a gzip archive (so can be opened with 7-zip for those who are interested), containing XML or similar files for configuration, scripts as text files and images, sprites, music etc. as binary files.
That way we don't have to spend too much time designing a file format of our own, can access resources easily and power users can edit the contents manually. Think of a quest not so much as a file, but a folder that can contain lots of files of different types.

#182 lonegraywolf

lonegraywolf

    Doyen(ne)

  • Members
  • Location:Minneapolis, MN

Posted 30 June 2010 - 01:55 PM

QUOTE(Koopa @ Jun 30 2010, 12:17 PM) View Post
For the file format, I suggest doing what OpenOffice does - the main file is a gzip archive (so can be opened with 7-zip for those who are interested), containing XML or similar files for configuration, scripts as text files and images, sprites, music etc. as binary files.
That way we don't have to spend too much time designing a file format of our own, can access resources easily and power users can edit the contents manually. Think of a quest not so much as a file, but a folder that can contain lots of files of different types.


You've got my support for this one. Granted, I don't know how to program that yet (or too much in general), but you've got my support nonetheless.

#183 lucas92

lucas92

    Defender

  • Members

Posted 30 June 2010 - 03:19 PM

This might be helpful for writhing gzip files : http://www.zlib.net/

btw, there should be some kind of list of volunteers on this project, what they can do to help.

Edited by lucas92, 30 June 2010 - 03:24 PM.


#184 Cameron

Cameron

    Illustrious

  • Members
  • Real Name:Matt
  • Location:South Jersey

Posted 30 June 2010 - 03:53 PM

QUOTE(lucas92 @ Jun 30 2010, 04:19 PM) View Post

This might be helpful for writhing gzip files : http://www.zlib.net/

btw, there should be some kind of list of volunteers on this project, what they can do to help.



All I can do is... nothing. Except maybe beta test for Linux. I don't really know any code, though this has inspired me to learn C++. Too bad. I have so much free time I don't know what to do with myself.

Edited by XxGamasterxX, 30 June 2010 - 03:54 PM.


#185 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

Posted 30 June 2010 - 05:18 PM

I think it's great that so many people are willing to help. You guys are awesome. icon_thumbsup.gif ..I know jman has been thinking re-write longer than just about anybody I can think of. I wonder what he'd have to say about all this?



[edit] I'm checking out google wave (never used it before) ...I feel so behind the times sometimes... I don't even have a facebook page. ..You dang kids and yer wacky internets.
[editmore] Err ..yeah google wave is pretty slow. I have to not allow any scripts for it to load properly.

Edited by Gleeok, 30 June 2010 - 05:25 PM.


#186 lucas92

lucas92

    Defender

  • Members

Posted 30 June 2010 - 05:47 PM

Are you using Google Chrome? I have a rather old computer and I can run it rather fast. The gadgets make it laggy a little bit but everything is fine.

#187 lonegraywolf

lonegraywolf

    Doyen(ne)

  • Members
  • Location:Minneapolis, MN

Posted 30 June 2010 - 06:58 PM

We actually removed one of the gadgets BEACUSE it was starting to lag up on most of us. You should enable scripts again Gleeok: it should be fine.

If it's not fine...time for you to upgrade your computer. icon_razz.gif

#188 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

Posted 30 June 2010 - 07:30 PM

Eh, I still can't interact with the page when I enable scripts.

I probably need a new computer though. >_>

#189 Hoten

Hoten

    Doyen(ne)

  • Members
  • Location:Pearland, Texas

Posted 01 July 2010 - 01:01 AM

So what comes first? The editor or the player? Sort of reminds me of the chicken or the egg =P

Also, with this new scripting approach, I have a few inquires...will we have such features such as extending a class, so, for example, you could make a base Octorock class, and simply extend it and adjust variables/functions to create the Red, Blue, and Crack baddies.

Events. When I think of events, I think of ActionScripts simple event system, where you could simply listen for an event with "addEventListener(<event type>, <function to call>)", and say, for the event NO_ENEMIES, whenever all the baddies are dead it fires up the event chain and notifies any objects listening for that event. I don't know if there is any other way to do an event system, but this would seem like the simplest approach.

I had an idea of possibly making a randomly generated block puzzle via scripting. The script would go through an algorithim that I've yet to create, and then create the necessary blocks/"flags". Stuff like that would be amazing.
...or is that already possible with 2.5 scripting? I haven't ever bothered with that.

Edited by Hoten, 01 July 2010 - 01:01 AM.


#190 Bourkification

Bourkification

    Magus

  • Members

Posted 01 July 2010 - 06:08 AM

QUOTE(Gleeok @ Jul 1 2010, 08:18 AM) View Post
I think it's great that so many people are willing to help. You guys are awesome. icon_thumbsup.gif ..I know jman has been thinking re-write longer than just about anybody I can think of. I wonder what he'd have to say about all this?
Do you wanna send him a Pm/email about it and give him the link to the Wave and see what he has to say about it? Because it looks as if his a little over developing 2.5, so maybe this is the boost he needs to get back into career best developing form.


#191 Beefster

Beefster

    Human Being

  • Members
  • Real Name:Justin
  • Location:Colorado

Posted 01 July 2010 - 11:44 AM

QUOTE(Hoten @ Jul 1 2010, 12:01 AM) View Post

So what comes first? The editor or the player? Sort of reminds me of the chicken or the egg =P

Generally, the player should come first. The editor will be "tagging along closely behind"- as it will greatly improve the development speed when we get to the beta stages.

QUOTE(Hoten @ Jul 1 2010, 12:01 AM) View Post

Also, with this new scripting approach, I have a few inquires...will we have such features such as extending a class, so, for example, you could make a base Octorock class, and simply extend it and adjust variables/functions to create the Red, Blue, and Crack baddies.

That's the plan.

QUOTE(Hoten @ Jul 1 2010, 12:01 AM) View Post

Events. When I think of events, I think of ActionScripts simple event system, where you could simply listen for an event with "addEventListener(<event type>, <function to call>)", and say, for the event NO_ENEMIES, whenever all the baddies are dead it fires up the event chain and notifies any objects listening for that event. I don't know if there is any other way to do an event system, but this would seem like the simplest approach.

Not what we had in mind, but it's definitely something to consider implementing. Perhaps add an arbitrary event listening menu for each screen?

Think RPG maker. Their events system was essentially laymen's scripting. You dos something to the "event" and it can change stuff about the screen and set global variables.

QUOTE(Hoten @ Jul 1 2010, 12:01 AM) View Post

I had an idea of possibly making a randomly generated block puzzle via scripting. The script would go through an algorithim that I've yet to create, and then create the necessary blocks/"flags". Stuff like that would be amazing.
...or is that already possible with 2.5 scripting? I haven't ever bothered with that.

It's already possible, and it will be even simpler with ZM.

#192 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

Posted 01 July 2010 - 04:37 PM

I tried out SFML. There's no way I'm going through this thread to find it or quote anything, but there was an OpenGL debate coupled with an SFML and Multi-Media-Library debate in these pages, and I said I would try it out and do some tests on SFML. So here they are:

http://www.purezc.co...o...c=46089&hl=


As for SFML itself I have mixed feelings about it, both good and bad. ...I'll spare you from it though unless anyone wants to hear it. =P

#193 Beefster

Beefster

    Human Being

  • Members
  • Real Name:Justin
  • Location:Colorado

Posted 01 July 2010 - 10:04 PM

Is SDL faster or slower than SFML?

#194 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

Posted 01 July 2010 - 11:05 PM

QUOTE(Beefster @ Jul 1 2010, 08:04 PM) View Post

Is SDL faster or slower than SFML?


What do you mean by 'faster'? ... I'm not really understanding the question.

#195 Hoten

Hoten

    Doyen(ne)

  • Members
  • Location:Pearland, Texas

Posted 02 July 2010 - 03:21 AM

I'll just document how I think it should work here.

You have 2 classes - Event Dispatcher and Event Object

The Event Dispatcher is what dispatches Event Objects to it's Listeners. Related events would be kept under the same Event Object (such as LinkEvent.ATTACK, LinkEvent.MOVE, or LinkEvent.TAKE_DAMAGE) For an example, I'll be demonstrating how those events could be implemented.

EventDispatcher - Central hub for Listeners

CODE
private static assosiative_array Listeners = new assosiative_array()

public static void AddListener(string type, function func){
    if !assosiative_array.contains(type){
        assosiative_array.add(type, new List())
    }
    assosiative_array.get(type).add(func)
}

public static void DispatchEvent(EventObject Event){
    List L = assosiative_array.get(Event.type)
    if L != null{
        for int i = 0 i < L.size() i++{
            function f = L.get(i)
            f(Event)
        }
    }
}

EventObject LinkEvent - groups all of the Link-Specific event strings

CODE
public static string ATTACK = "attack"
public static string MOVE = "move"
public static string TAKE_DAMAGE = "takeDamage"

public LinkEvent(String Type, Enemy Target = null, int Direction = 0, int Damage = 0, int WeaponType = 0){
    <pretend I declared similarly named public variables as the parameters above outside this constructor, ... and that I set them accordingly here>
    
    EventDispatcher.DispatchEvent(this)
}




Now, with all that set, let's recreate something from ALTTP. Remember those golden floor shooter things that would shoot a fireball whenever Link slashed his sword? Well, that'd be pretty darn simple to recreate! Here's some pseudocode.

CODE
public Golden_Shooter(...){
    ...
    ...
    EventDispatcher.AddEventListener(LinkEvent.ATTACK, Shoot)
}

private function Shoot(LinkEvent Event){
    if Event.WeaponType == WEAPONS.SWORD{
        //Shoot!
    }
}

Great. The only thing left to do, is to have an LinkEvent instance be created everytime Link does one of the actions above (attack,move,takedamage). You'd need to do that in Link's own little script, which would be easy enough.

So yeah, that's a pretty basic and efficient way of doing it. Here's a summary of what's going on above for you code illiterates: Whenever the AddListener function is called, a function is placed inside a List which is stored in an assosiative array. That way, the a whole list of functions that are to be called when a specific Event occurs can be retrieved by doing assosiative_array.get("eventname"). Now, when the event occurs, the scriptor would have to make a new instance of LinkEvent, with the proper event type string and parameters, which would then be sent to the Dispatcher, where the magic happens. The Dispatcher will loop through the List of functions, calling each one and passing along the Event object, which will let the scriptor read into the details of that specific individual event, and take desired actions.

I hope I explained all of this well enough. I think this would be just perfect, and simple to do the whole GUI thing with too. Anyone think otherwise?

Edited by Hoten, 02 July 2010 - 03:24 AM.



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users