Forum Fighters: Rewritten (Discontinued)

looking at your gifs, they are really slow… are the gifs just slowed down or is that actually the speed that the game runs for you?

also, when i first made a sample bot, i just disabled keyboard movement of one of the players and used code to determine what actions to do. i didn’t make a new object thingy. (if needed I’ll go in more detail tomorrow, it’s getting late for me)

1 Like

https://drive.google.com/file/d/1cNPCL4IXs-57OGDLbFWy6CJutpYlAZdV/view?usp=sharing

I made a new song for the game! I don’t know if I’ve shown it to you or not (I have bad memory) but please tell me what you think! You can code it like @nick did:

playSound(“sound.wav”, {loop: true, volume: 0.5})

That is the actual speed of the game. :pensive:.

Meanwhile, I did take note of the fact that the Players and player bots are controlled using bolleans, but we’re not making player bots.

The enemy just needs to react to walls and holes. I thought it was simple enough, since I’d just let the platformer engine do it’s thing and push back the enemy from falling through the walls like how it did with the player controller.

1 Like

That is a little bit ambitious… I know that the game has platforms, and for local vs mode is doable… but programming AI to react to all kinds of environments, holes, platforms, etc… is another level of complexity. It is not impossible, but it could be a difficult task. You may need another AI methodology to accomplish that, such as machine learning or so…

Machine learning? Surely you don’t need machine learning to make a basic 2D platformer AI.

Get ready for another long post…

About audio, things to do for those who want to help, and creating cutscenes in the future that run at the correct fps

I decided to try playing all the sounds once at volume zero in a default script and stop all sounds in the load script in the intro, I think it worked but not really sure.
FFR 1.5.1 - WIP6-24-2022_12-18-14.wick (2.7 MB)

I also used this file:

(Also, thanks @KringlePrinkles for working on that, I appreciate your efforts and attempts of making the ai work properly)

And …

I checked the file, someone had added a // before the line that plays the audio for that clip (on mouse enter).
When I remove the // the project returns an error, so I’m guessing the audio file might’ve been removed before I updated it at some point ? I don’t remember how it sounded, but I know we have a lot of audio assets for buttons, we could replace it with one of them.

I’ll look more at it later when I find the time.

btw, I might’ve forgotten to mention this, but I have a folder with all the audio files that were in the project before I removed them. They can also be found on repl (I’ll remove this link after a certain amount of time since anyone with it could delete, remove, and edit the files - if that happens I already have a copy of all audio files on my computer).


I'll just be adding some other things here for anyone in the team who's looking for a way to help

The keybinding doesn’t seem to work at all.
This should be easy to fix.


The library will be needing some editing


(By “editing” I don’t mean writing more in the books, but rather making some slight adjustments to perfect it more, for example, the top left half blue and half red button could be turned into a bookshelf)


According to the gif the fps starts at 12 and goes down to 9 when the game is played.
I experienced a similar issue when testing the game on a school device.
It’s a frustrating part of development when you know that not all devices will be capable of having the same experience, that’s why for story mode I want to consider using a video element (see this project here for a good idea of what I mean) for cutscenes. This way, we could make sure that animations will play at the correct fps. We’ll focus more on this later, I just wanted to mention it now to see what you guys (the team) think of it since the cutscenes won’t be available during an offline gameplay.

In my tests of the version from a few days ago, up gates don’t work because of this one test:

I have a feeling it’s supposed to be !target.canGoThroughUpGates

Actually, looking at the comment in the declaration of that variable, it seems that it should actually be this:

Basic 2D platformer AI doesn’t fall into a “basic” category to me… but that is just me :wink:

Well as long as it doesn’t do pathfinding. If all it does is jump over gaps and on top of blocks, it shouldn’t be too complex. It can find gaps by analyzing the platform array with its jump arc.

@mlgcoolguys_1
I’m not sure if this AI’s supposed to be smart enough to, for example, reach the target in situations like this:
image
Would the AI actually jump on the platform on the left, then the platform on the right to reach the target? Or would it just get stuck moving back and forth below the floating platform?

Here’s my progress for now
0FORUMFIGHTERS.wick (2.7 MB)

  • I rewrote the enemy behavior system. Each enemy has two functions: one for setup, and another one for update.
  • Entities have an array named “collisions” which store the data of platform collisions that occured since the last entity update. I used this to make the bot flip directions when it touches a wall.
  • Rewrite of the AI
  • Bug: The bot falls through the floor for some reason.

Several questions (to help visualizing the big picture):

  • Is this game a 1 vs 1 campaign mode?
  • Are you programming one generic AI for all the enemies?
  • Have all the levels/stages the same number of platforms in the same layout?
  • Will enemy #1 be always under Stage/Level #1 ? or enemy #1 can be found in different Stages?

Update:

How do I activate the begin?

it works fine for me…

Ok, the second time, I was able to play… not sure how I have activated that bug… I will try to reproduce it…

All things aside, I can see al the effort. The game looks beautiful.

I have an optimization idea.

So a huge source of lag is the engine getting the activeNamedChildren of the closest ancestor clip whenever a script runs (This is so scripts can get references to other clips). The game loop is located in the frame in the functions layer, meaning the closest ancestor clip is the Project clip. (Which has a lot of children). So if we put everything game loop-related in a clip instead of in a frame which is a direct child of the Project, we should experience a performance boost (in theory). We’ll also probably need to fix the clip references after this has been done.

Screenshot of profiler because why not it's cool


As you can see, after running all the scheduled scripts, the engine takes 11.6 ms in total in the activeNamedChildren function. This is also in my optimization mod, where I tried optimizing it to use that function less. I say I tried because looking at the profiler data, it appears that it doesn’t work as I intended.

(Our target is at most 33 ms per frame, which would achieve 30 FPS)

tl;dr put main game script in a clip, which is inside another clip.

1 Like

Another thing is, you can make a png of the entire stage… and only separate the animated things like the tree in other pngs. So you will end having only few pngs, and some hidden colliders.

2 Likes

Wow, how do you do that? Do you do that within Chrome, or do you have another software for that?

In the dev tool’s performance tab

2 Likes

Well the answer would be both.

A more simple enemy (such as the one you are coding now) would just move back and forth helplessly

But more advanced enemies WiLL be more then happy to jump around if it means it can attack you

1 Like

Okay. So the more advanced enemies pathfind.

Wait why are we working on enemy ais? shouldn’t we be working the fighters like the attacks and stuff?

Also, I’d like to be working on networking, since I think that’s kinda important, but I’m not sure how the game’s garbage performance would affect the way I’d like the netcode to be designed – In vanilla Wick Editor anyway. In my mod it can run at around 25 FPS. (I’d like to share a link to it for development but I guess it’s probably against the ruIes. Maybe I’ll make a pull request sometime.)

works fine for me