00:00
00:00
Gimmick
Thanks for dropping by!
NOTE: My outbox is full, so I may not be able to reply to PMs directly - might PM a reply via my alt or through comments.

Student

Somewhere

Joined on 8/20/08

Level:
28
Exp Points:
8,428 / 8,700
Exp Rank:
4,355
Vote Power:
6.96 votes
Rank:
General
Global Rank:
386
Blams:
1,969
Saves:
23,283
B/P Bonus:
48%
Whistle:
Silver
Medals:
2,487

Gimmick's News

Posted by Gimmick - January 12th, 2024


Je suis (un peu) triste de vous tous dire que je n'etudiera pas le francais tant qu'avant. Non, si je precise un peu, c'est que je ne veux pas ameliorer mon francais comme je faisais fin 2018-2019. J'essaiera a rester en forme, mais ca serait un peu difficile parce qu'il n'y a pas beaucoup de choses francaises qui m'interessent ces jours-ci. Alors, il se peut que mon niveau de francais diminue lentement de plus en plus. Ce qui m'a pris, par example, 10 minutes a ecrire peut maintenant prendre 15, ou 20.


I'm a bit sad to say that I won't be studying french as much as I had in the past. Well, to be more specific, I don't want to improve my french like I'd done at the end of 2018-2019. I'll try to keep in touch with the language, but it's gonna be a bit difficult because there aren't too many french(-related) things that interest me these days. So, it's possible that my level of french decreases slowly over time. Something that took me -- for example -- 10 minutes to write might now take 15, or 20.


Mais merde, je n'ai meme plus un clavier francais, donc tout ce que j'ecris c'est sans accents, circonflexes et tout ca. Bon, tout etant dit, je peux au moins dire que j'ai

  • pas tout oublie
  • eu du fun dans le passe en apprenant la langue

et peut-etre, a l'avenir il y aurait des opportunites a utiliser la langue plus frequemment ? Maintenant, meme en etant au Canada, je l'utilise presque jamais, parce que je vis dans un cite totalement anglo, donc il n'y a personne qui parle francais au quotidien autours de moi, ni besoin non plus.


Like hell, I don't even have a french keyboard anymore, so everything I'm writing has no accents, circumflexes or what-have-you. Well, all said and done, at least I can say that I've:

  • not forgotten everything
  • had fun in the past when learning the language

and maybe (just maybe) in the future there might be more opportunities to use the language more frequently? Now, even though I'm in Canada, I almost never use it, because I live in a city almost entirely anglophone, so there's almost nobody who speaks french around me in daily life, nor is there any need to speak french either.


Mais ce n'est pas la fin, en revanche, sachez qu'il y a toujours un debut. Mais ca c'est une autre histoire...


Tags:

2

Posted by Gimmick - March 19th, 2023


AT LONG LAST, LET'S FUCKING GOOOOOO

iu_925984_2555669.png

So this is what it feels like to win the lottery lol


Tags:

17

Posted by Gimmick - March 11th, 2023


In my previous newsposts I mentioned I'd been working on ASBoxer/HitShaper/name TBD, and, well looks like time can make a codebase degrade even if nothing's been done to it. It's almost a decade since I first started the project (and 4 years since I stopped working on it) and while the code is readable, it's of somewhat suspect quality.


The document class, main.as, has 7724 lines. 7724. While it's no yandere dev nightmare of if-else chains, and most of the code there serves a purpose (...mostly handling UI stuff...) it's still a warning as to why people shouldn't work on projects solo for continuous periods of time - when you get used to the code base, it can sprawl real quick. And sure, it's probably "necessary" in that there's no duplication, but splitting it off into different classes also felt wrong at the time?


In any case, this was my reaction in a nutshell (warning: loud)

I almost want to just open-source this and make this someone else's problem, but then I realize I'd be a) exposing others to my terrible code (and it's coded in AS3, so insert terrible pun about flashing others ahahaha) and b) nobody's gonna work on it.


Funnily enough the application works, it's just a few parts here and there that are borked to the high heavens. Unfortunately those are the core parts to until I fix those, it's just a shiny user interface and not much else.


Posted by Gimmick - August 3rd, 2022


I'm learning Godot 4! Or at least, as much as I can given all the other stuff on my plate, haha.


I'm definitely going about it in a very roundabout way that I don't really recommend for others, given that I've always learnt this way and others may find it better to learn in a systematic manner. So I'm getting started with Godot scripting and coming from an AS2/3 background, I'm finding a lot of similarities between Godot's event system and Flash's event system. It's not surprising since both use a tree-like structure (Flash uses the Display List, whereas Godot uses Nodes, but both are effectively the same as the Document Object Model).


This newspost is an attempt to document the equivalent events / methods when moving from Flash to Godot. It's highly likely that I'll be proven wrong about my initial assumptions as I use the engine more, which is why this isn't a thread in the Game Development Forum yet.


Each bullet point in the sections below shows the event as it is named in Flash (AS3), with the AS2 equivalent (if available) and the Godot equivalent following it. All Godot examples use GDScript.



Constructor

public function ClassName() {
    //init
}

AS2:

onClipEvent(load) {
    //init
}

Godot:

func _init():
    pass

Event.ENTER_FRAME

import flash.events.Event;
function run_every_frame(evt:Event):void {
    //run
}
sprite.addEventListener(Event.ENTER_FRAME, run_every_frame)

AS2:

onClipEvent(enterFrame) {
    //run
}

Godot:

func _process(delta) -> void:
    pass

(There's also _physics_process(delta) which is independent of frame rate, but the direct equivalent is just _process since almost everything in Flash is dependent on the frame rate)


Event.ADDED

Triggered whenever a DisplayObject is added as a child of a DisplayObjectContainer, regardless of whether they are on a Stage or not.

import flash.events.Event;
function added_to_other_mc(evt:Event):void {
    //added to other mc
}
sprite.addEventListener(Event.ADDED, added_to_other_mc)

AS2: N/A

Godot: The direct equivalent appears to be "NOTIFICATION_PARENTED"

func _notification(id) -> void:
    match id:
        NOTIFICATION_PARENTED:
            pass

Event.REMOVED

The counterpart to Event.ADDED. Like ADDED, does not require the DisplayObjectContainer to be on a Stage or not. However, this is -for some reason- triggered before the object is removed, rather than after. This has historically lead to some hacks involving Timers or ENTER_FRAME events when running code after it is removed. A better name would have been "Event.REMOVING" as that could have also allowed it to be cancelable, but...oh well.

import flash.events.Event;
function removed_from_other_mc(evt:Event):void {
    //will be removed
}
sprite.addEventListener(Event.REMOVED, removed_from_other_mc)

AS2: N/A

Godot: It appears NOTIFICATION_UNPARENTED is the closest equivalent. I'm not sure whether this runs before or after the node is removed from its parent. Looking at the docs, it appears to be run after it is removed, but I haven't run it to verify.

func _notification(id) -> void:
    match id:
        NOTIFICATION_UNPARENTED:
            pass

Event.ADDED_TO_STAGE

Triggered when a DisplayObject is added to a Stage (yes, multiple Stages can exist in Adobe AIR, and this triggers whenever it is added to any of them)

import flash.events.Event;
function added_to_stage(evt:Event):void {
    //added to stage
}
sprite.addEventListener(Event.ADDED_TO_STAGE, added_to_stage)

AS2: I believe onClipEvent(load) does the same thing here, but the reference says onLoad runs whenever a MovieClip is added to the Stage (there's only 1 in AS2).

movieClip.onLoad = function() {
    //added to stage
}

Godot: Looks like _ready is the main equivalent here.

func _ready():
    # added to scene
    pass


I might add more as I work with Godot more. Depends on how much time I can afford to put into this right now.


First impressions: GDScript and Godot seem to be very clean and minimalistic in terms of verbosity. I think the design philosophy of Godot is that each Node has only 1 script and so an event system like Flash's doesn't make much sense in this context, but looking at the _notification function, it seems a bit clunky to have a sort of "master" function that gets an ID and then delegates it to other functions / branches. Of course, I'm biased towards how AS3 does it, but I think something like an

addListener(NOTIFICATION_ID, function)

might have been cleaner here. Looks like time will tell as I get used to GDScript.


Update: So it seems like Signals in GDScript are the equivalent of Listeners in AS3. However, I'm unsure as to why there's both signals and notifications. It sounds like it would be better to have just signals be used, with each Node subscribing to notifications the same way they would signals...but I'm not sure if or why that's not done.


Tags:

5

Posted by Gimmick - June 11th, 2022


i'm 24


2

Posted by Gimmick - March 19th, 2022


What is this?

I had a discussion with @The-Great-One a while ago on how to make editing the Newgrounds Tank Tribune easier. In my experience, VS Code is a very good text editor with a load of features designed not only for editing code - despite the misleading name - but also for more general-purpose text editing like Notepad++ and others.


That being said, this CAN be used for making newgrounds News and Forum posts! I’ll show the process below. In my initial comment I had suggested using Pandoc, but turns out it wasn’t needed either because of a set of fortuitous circumstances!


Fortunate circumstances

That is, I had assumed that ‘RTF’ was the only format that Newgrounds supported. Turns out it also supports HTML; this is great because it vastly simplifies our workflow - the default Preview in VS Code for “AsciiDoc” can be used - so you can copy the generated preview and paste it directly into the newspost box!


Here’s the process for creating a News post using just VS Code and AsciiDoc:

  1. Install VS Code, and install the AsciiDoc extension.
  • Press Ctrl+Shift+X to open the Extensions panel, and search for AsciiDoc (install the one by asciidoctor)
  1. Create a blank file and type up the content using asciidoc. This is fairly straightforward if you have a decent grasp of asciidoc already, but given that it’s not as common as markdown there’s going to be a short learning curve attached.
  • If you need syntax highlighting to make it easier - see the option in the status bar at the bottom right corner that says Plain Text? Click on it, and type AsciiDoc. It’ll then highlight valid asciidoc syntax where it can.
  • Here’s a quick reference for AsciiDoc.
  1. Press Ctrl+Shift+V to open up the preview.
  • Alternatively, press Ctrl+Shift+P to open up the Command Palette, and type asciidoc open preview or similar.
  1. Select all the text and copy it: Ctrl+A, Ctrl+C
  2. Open up the newgrounds news post page and paste the contents in the text box.
  3. Voila, you’ve converted asciidoc to a newgrounds post!


Press Ctrl+Space to open up a list of the frequently used words using IntelliSense. This will open up a list of frequently used words, which is especially useful if you’re repeating them, e.g. in the case of usernames.


Including images works! Unlike markdown, asciidoc has the option :data_uri: directive which means that all images will be embedded using data URIs, so you can copy those directly into the newspost. Just remember to include it in the top of every doc, just below the main header, and you’re good to go. The only downside is that large images can make the preview take a while to generate, because it’s effectively converting it to text. Still, that’s a small price to pay for the convenience!


Caveats

Unfortunately, IntelliSense/Ctrl+Space does not seem to work well with usernames with hyphens in them, and it doesn’t recognize the @ as belonging to a username mention, as it only seems to look for whole words in a programming context (i.e. variable name rules - words_separated_by_underscores are treated as one, but words-separated-by-hyphens are not; @ is not considered a standard part of a variable, so it doesn’t show words that begin with an @ like @Gimmick or @The-Great-One on Ctrl+Space)


Videos aren’t supported, period - those will have to be embedded manually. Even though AsciiDoc supports embedding videos, it won’t be ported to the newspost because the embed metadata is stripped when copying the text from the preview. Unless Newgrounds supports uploading AsciiDoc files for posts, it’s not likely that you’ll have newsposts achieve 100% asciidoc → news post feature parity (although 90% isn’t bad).


Also, paragraph info is stripped out when you copy from the preview to the post. That is, empty lines are stripped from the clipboard when pasting into the file. As a workaround, you can have empty lines by pasting {sp} + into a new line between each paragraph. Perhaps this will be less inconvenient in the future if blank lines are included between paragraphs when copying HTML into the newspost box.


Finally, the preview includes a "Last Created at <date>" footer which is also selected when you select all text. You’ll need to remove that manually.


Closing thoughts

This section is primarily addressed to @The-Great-One, as it concerns the Tank Tribune.


Hopefully this speeds up your workflow a lot, especially if you make an asciidoc template. And what better way to prove it’s possible than by dogfooding? Yes, you read that right - this entire post (title notwithstanding as that’s a separate text field) has been written using the above steps.


And to help you get started, I’ve included a template of last week’s Tank Tribune so that you can get an idea of how it works! Alternatively, just replace the text in the paragraphs with content for the upcoming weeks.


There’s obviously far better templates that could be made but this is a starting point. (Someone experienced with AsciiDoctor could probably make a far better one, and would probably also be appalled with the one I threw together.) Download the repo as a zip, extract the files to a folder and open the .adoc file in VS Code and you can get started editing right away.


DOWNLOAD TEMPLATE


Tags:

3

Posted by Gimmick - June 10th, 2021


i'm 23


14

Posted by Gimmick - December 31st, 2020


I haven't got enough clout to be listed on the Community tab, but I figure since everyone's doing one of these things, why not join in?


I started the year off with "Happy New Year!, or why you should watch the Joker movie". Back when movies in the theater were still a thing, haha. It's aged well, I suppose.


The pandemic seemed like such an outlandish prospect back in January and February. Despite having heard of it through friends with family in China, it seemed like it was one of the regular articles that would pop up every 4-5 years and fizzle off after a period of time. Classes were being held in person, and it wasn't unheard of to see thousands of people milling about every day. Back when it was still colloquially referred to as the wuhan coronavirus.


I guess Ebola made me too optimistic. Or maybe I had been desensitized because of it and wasn't paying attention. Or both. In the meantime, other things kept stealing the show. The incidents involving Iran. The australian bushfires. And some more I don't recall.


I took part in a hackathon, and submitted a game to NG that I made during that time.


Cyberpunk got delayed.


I took up swimming. (I'd long been meaning to do it, and with the weather getting warmer I could go in the morning a little easier. And it seemed like a good enough physical activity to take up.)


It's crazy to think about how lax we were back then. It almost feels like a different universe altogether.


I started watching anime again around this time. I'd briefly stopped watching anime from August to December, because I always used to watch it with my brother - it's better enjoyed with an audience. Oh well, I suppose talking about it is good enough.


Then came the alerts. News of cases popping up in Iran, Italy, and other countries. It still seemed like a faraway fantasy, even though it was all but knocking on the door.


It’s going to disappear. One day, it’s like a miracle—it will disappear.


I still remember joking about it, although it became less funny as time passed. I remember attending Kent Beck's talk back on the 4th of march. Packed rooms, small spaces, a buffet.


What was I thinking!? What were they thinking!? What was anyone thinking?!


I like the numbers being where they are. I don't need to have the numbers double because of one ship that wasn't our fault.


Less than a week later, Italy would lock down. Things had reached a boiling point there.


Then came the deaths. Oh, the deaths. It was gruesome. Even without being in Italy, it felt chilling to witness.


(On a lighter note, cue the coffin dancers! It's hard to believe that was this year.)


Classes had, of course, shifted online at this point.


I consider myself fortunate enough to not experience the brunt of the pandemic and its knock-on effects. I tried picking up some new languages (Rust, JS, again). I tried learning how to draw; after all, I had a graphics tablet, and what better way to make use of it? Hell, while I was at it, why not try continuing to learn french - surely a B1/B2 course would be good to take, right?


I dropped them all like deadweight when other things took priority. I had spread myself too thin, again. I guess the only mainstay of the lockdown was the fact that I took up cooking more often during this period, as a matter of necessity. That was a nice benefit I suppose, because my diet before that was rather unsustainable.


Went to the ER for gastrointestinal trouble not a week after the lockdowns. Thankfully it wasn't anything serious. Although it did feel like there was an air of tension around the city as a whole (and for good reason), and I'd get that same feeling whenever the bus stopped at the hospital en route.


A month or so after the lockdowns, things seemed to be improving, well in some countries moreso than others at least.


My research started in summer. Lotsa reading.


Found out about syncplay and other video synchronization services and this really helped me watch anime regularly again.


Resumed work on ASBoxer and the AIRDock and Syncomps libraries - it'd been a long time since I'd touched them, and it felt good to be back.


The months after that, well...I suppose it all went by in a haze. I'm leaving out the George Floyd incident, the protests, and the other bits of news that happened around that time because it just sort of blurred together. All I remember feeling was this vague notion of "how is it gonna get worse next?" when it came to any sort of US news. I can't think of many things of note in the months of June, July, August and September, except for maybe my birthday, and the fact that research progressed from "reading" to "experimenting".


Then came October, the debates, then November, the election, and fun was had at each step of the way. Mostly at the clownshow's expense, sorry not sorry.


Cyberpunk got delayed again.


Fast forward to December. Cyberpunk's finally out. It's meh. Better luck next time.


Year's over in a flash. Scene. Roll curtains.


---


The biggest personal achievements I suppose I can claim are learning something about neural networks and machine learning. Prior to this year, I didn't know all but the vaguest stuff about it.


There's a lot more that I've probably forgotten to include here. A year IS a long time, after all, and this was one of the longer (and somehow shorter) ones.


What's 2021 gonna be like?

We'll see.


The temptation to take on too much and spread oneself thin is too easy at times. That just ends in failure, though.


I'm inclined to continue learning french, but I'm unsure as to the rate. I'm eyeing online classes, but that is also TBD.


I may pick up drawing again. I'll have to see how to balance this so that it doesn't end up being tossed to the wayside.


I have no idea when ASBoxer will be completed, nor do I think anyone cares. Even though it runs on AIR and so will continue to exist even after Flash is discontinued as of today, I think the landscape of tools has changed so much over the past years that ASBoxer's raison d'être is possibly moot at this point. Even so, I suppose I'll finish it for posterity's sake.


AIRDock got an update! It's finally got one feature I'd been working on for quite a while - remembering the locations of panels in their rooted positions.


And take all the plans with a grain of salt - they don't always turn out as expected :)


4

Posted by Gimmick - October 30th, 2020


So that start before was a false start. Doing it the right way resulted in problems with having it be synchronous, and doing it fast would've probably made it break somewhere down the line. Given that I was planning to use this in ASBoxer by porting it to Flex, I tried making some mockups and I didn't like how it'd've turned out.


Status: Halted until further notice. I'll finish ASBoxer first and return to this if I think it'll be useful.


2

Posted by Gimmick - October 19th, 2020


Yeah yeah I know Flex is outdated tech but it has shiny buttons and who doesn't like shiny things??

Well, this aged poorly. FlexDock (the planned AIRDock -> Flex port) has been put on hold until further notice.


Original post follows below.

---


Yeah yeah I know Flex is outdated tech but it has shiny buttons and who doesn't like shiny things??

Thankfully AIRDock is already generic enough that porting to flex just requires changing a few methods here and there! The DividedBox component is good enough as a "native" container; that means a lot of the stuff is already handled by Flex, and the major things to handle are just

  1. traversal
  2. creation
  3. dragging

containers! I'm not sure whether to achieve a PoC based off a direct port to AIRDock and then pare it down until the bare minimum is remaining, or to start from scratch and build up from there.


Starting from scratch has the benefit that I won't include useless cruft, but using AIRDock means I can retain compatibility and interop with pure-AS3 applications as well, which is also a huge selling point. Currently I'm leaning towards approach #1, especially since I have working results already! Voila:


iu_182716_2555669.png


All of this has been done just by calling AIR/FlexDock functions! I realize it's not a lot, especially since the following MXML code does almost the exact same thing and is more optimized:

<mx:HDividedBox width="100%" height="100%">
  <mx:HDividedBox width="50%" height="100%">
    <s:Panel title="leftmost" width="50%" height="100%"/>
    <mx:VDividedBox width="50%" height="100%"/>
        <s:Panel title="middleup" width="100%" height="50%"/>
        <s:Panel title="middlebottom" width="100%" height="50%"/>
    </mx:VDividedBox>
  </mx:HDividedBox>
  <s:Panel title="rightmost" width="50%" height="100%"/>
</mx:HDividedBox>

But it's a start!


Further optimizations include collapsing all containers on the same level (e.g. "LLLLRF" is all on one level instead of 5, because HDividedBox supports multiple containers per level instead of just 2), along with classic Flex optimizations like deferred initialization and rendering, but those are left to much later - especially because I've just been winging it almost all the way and have started learning Flex only now (which is rather stupid of me because good luck finding tutorials that don't lead to dead links 50+% of the time...praise The Wayback Machine!)


Also, while using Apache's Tour De Flex to familiarise myself with the components available in Flex, I came across the third party Ardisia Components Library. It has pretty much everything that AIRDock/FlexDock aims to do but much better, and it even has "native-like" Windows skins as well! I would have just let this go and used that library instead to finish ASBoxer already, but there's always a catch...


...it's $600!

No way that any hobbyist is gonna use that library unless they already have it for some reason. That's a justified but outrageous price. For reference, I paid half that for my laptop.


Tags:

1