How do YOU organize your code?

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • I mostly just group things really well and manually organize object order in the event editor. All objects that pertain to each other (eg: collision mask + sensors) are next to each other so i can quickly alter code for each individual object.

    [MENTION=9754]Phi[/MENTION] - I used to use behaviors until I started running into weird scoping issues with them. Now with foreach loops built in there isn't really a need for behaviors. I might use them for simple things like applying effects such as fire to specific objects, but that's about it.

  • I mostly just group things really well and manually organize object order in the event editor. All objects that pertain to each other (eg: collision mask + sensors) are next to each other so i can quickly alter code for each individual object.

    [MENTION=9754]Phi[/MENTION] - I used to use behaviors until I started running into weird scoping issues with them. Now with foreach loops built in there isn't really a need for behaviors. I might use them for simple things like applying effects such as fire to specific objects, but that's about it.

    Yeah, ForEach loops are a godsend. I use them so much, it's absurd.

  • I use event behaviours on global objects. It has been a very (very) long time since they were problematic, perhaps pre 2.5?

    The biggest disadvantage of them was no qualifiers. Some small omissions also. However, with the DLC+ these disadvantages are no more. Also remembering object folders and being able to get to behaviours by right clicking on the objects makes using them so much easier.


    The reason I use global objects with event behaviours is that I can have hundreds of frames and easily update event logic and graphics across them all just by editing one. The missing link is not being able to use the Create object from another frame like you can in the frame event editor. I have been doing this for many years without any problems.


    I really like the load frame idea. I will try that.

    Andy H @ Please login to see this link. - Please login to see this link.
    Retro Gaming @ Please login to see this link.

  • Sorry to necro this post, but Volnaiskra's post has a little gem hidden there in the particles. I never imagined to use unicode character to better organize groups! This is great!

    Please login to see this attachment.

    It all can be found here:
    Please login to see this link.

    Is there any problem using these characters in the group? Probably not, maybe someone from Clickteam staff can clarify that...

  • Is there any problem using these characters in the group? Probably not, maybe someone from Clickteam staff can clarify that...


    Nah, Unicode characters are just like normal letters. The only issues with them come from reading the group name as non-Unicode; it'll display as one character long.
    Since only Fusion runtime reads group names, and it was used with much more complex Unicode via Japanese/Chinese characters, there's no issue.

    Darkwire Software Lead Programmer (C++ & C#)
    Please login to see this link. | Please login to see this link. | Please login to see this link. | Please login to see this link.

  • Nah, Unicode characters are just like normal letters. The only issues with them come from reading the group name as non-Unicode; it'll display as one character long.
    Since only Fusion runtime reads group names, and it was used with much more complex Unicode via Japanese/Chinese characters, there's no issue.

    Very nice. Thanks for the info Phi!

  • Sorry to necro this post, but Volnaiskra's post has a little gem hidden there in the particles. I never imagined to use unicode character to better organize groups! This is great!

    Please login to see this attachment.

    It all can be found here:
    Please login to see this link.

    Is there any problem using these characters in the group? Probably not, maybe someone from Clickteam staff can clarify that...

    I'm not sure which post you mean, but I've been using unicode characters, and even some Segoe emoji (which I think is different from unicode?) in the last few months, and I just love it. It's made my life much eaiser; it takes me significantly less time to scan through my code and find what I'm looking for, and seems to have lowered my general stress level when I'm working. Once you start looking, you can find useful codes for just about any topic:

    Please login to see this picture.

    I even found a little flag icon that I use on the end of every flag name, which helps me differentiate altVals from flags:

    Please login to see this picture.

    I asked about this a while ago, and Danny said something similar to what Phi said, and indeed I haven't found any problems. The only issues I've found are minor formatting ones. Occasionally, using a certain character in the expression editor will change the font for everything that comes after it for some reason (like, from Tahoma to Arial, or something like that - not a big deal). Some characters get displayed as rectangles in the expression editor (but they still work, even if you copy and paste them) - these are probably the emoji ones rather than the unicode ones:

    Please login to see this picture.

    Most characters look good in the actual event list editor (groups, conditions, & actions), though some of the weirder ones may get a little wonky, such as these underscore/overscore lines that get overlaid over other characters: they look good in the group name but a bit weird in the action:

    Please login to see this picture.

    Finally, I've found Please login to see this link. to be quite useful for finding characters. It's much quicker to use than the old Character Map app, and it has a good search function

    Please login to see this link.
    My Fusion Tools: Please login to see this link. | Please login to see this link. | Please login to see this link.

  • I'm not sure which post you mean, but I've been using unicode characters, and even some Segoe emoji

    Looks like I looked several posts in a row and one of them had a cropped screenshot of your particles group (with the character you use in groups) and I thought it was in this post one or 2 pages back. I even thought it was something specific to your Fusion theme (which I own) and in the end I found very surprising no one ever mentioned this anywhere. But very nice your level of organization is really top notch! Many thanks for sharing! That flag icon is a really nice idea too

  • I also don't use global events or behaviours, for much the same reasons as Phi. I don't use Global Values either - mainly because there's no way to organise them. They're just basically a single list of stuff, ordered by chronological order of when you happened to first create that variable. If you created the value jumpAmount early in your project and then a year later you added a double-jump feature and created doubleJumpAmount, then those variables will be miles apart in the list, even though you'll probably want to access both whenever you access either.

    Even just using Alterable Values for everything eventually got pretty messy and unclear, with me frequently clicking around multiple objects to try and find the altVal I was looking for. So a couple of years ago I tightened up my system, and I'm now really glad I did. I now store all variables in Active Objects that are organised by variable type. I even have somewhat strict requirements for the visual style of the icon I use for these Active Objects. They have to:

    Early this morning I was thinking about this. I'm still using Global Values to store my information :( I'm using Danny's fastloop routine to grab all values and save, it's like 3 lines of code where I use Global Strings dynamically.
    So, Global String A= Company Name
    Global String B= Game's Name
    Current profile =current profile selected.
    saveloops=number of maximum variables I'm using. The save uns up to the maximum of saveloops. I was using 256 just for the sake of it, but I'm leaving it dynamic now so I can easily change this because for some reason, 256 is making things very slow. It wasn't. Need to check why.

    I'd be very curious to know how you handle multiple profiles where you get variables for multiple objects. I assume that all of your Active Objects that store variables must be global, and have fastloop routine to load and save. Lots of "moving parts" there. If you plan to release a saving/player management asset it's a buy from me. It's probably far more complex that I'll ever need LOL, but interesting to check out nonetheless.

    Please login to see this attachment.

  • To be honest, I don't really understand what you mean. It seems like you store all your variables in ini files, which is interesting, but I don't do anything like that.

    I don't use any kind of fastloop routine on my value-holding active objects. I just set them once at start of frame and/or during the course of the game, as needed.

    Most of the variables I need to store wouldn't be affected by multiple player profiles. Things specific to the player (eg. Game progress, previous best level times, etc.) I store in an ini, but that's just a few things. Everything else (engine parameters, Spryke physics parameters, enemy states, etc.) will be the same for all players.

    Please login to see this link.
    My Fusion Tools: Please login to see this link. | Please login to see this link. | Please login to see this link.

  • Ahh.. this makes complete sense now. It only would be worthwhile if the player would carry something like bonus, magic, inventory or collectible items. Even for an inventory or something more complex yoru way of organizing with actives is a really good one. I think I'll adopt at some point... many thanks!

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!