Forum Fighters: Rewritten (Discontinued)

Uh yeah i also procrastinated and i was too embarrassed to check the forums to say anything. As you can tell I am the most reliable person on earth.

I think I chose wrong when choosing who to reply to.

1 Like

So I was thinking if there was a way to better organize the code. Right now, the majority of the code is in one 2850-line script. It’s good practice to put separate parts of code in separate files. So maybe we could have a GitHub repository to host/collaborate on multiple game code files. When someone wants to test the code in the game, they would combine all the script files into one and then copy+paste it into the game. (“Building” is a good word for this process)

So everyone’s able to access GitHub and knows how to use Git/Github Desktop. Right? It’s not like those are the two possible obstacles that would prevent us from pursuing this plan.

1 Like

There are tools for this, npm and others that could help you to convert all those separate files into a big one… (like WickEngine is built)

So just to be clear (and to ensure that everyone is on the same page… and would at some point all be simultaneously at different pages when using these tools), would everyone be using GitHub and npm? I’m asking mostly the co-leaders (@pumpkinhead and @awc95014, since they both have GitHub already) and Jovanny. While I do have a GitHub, I didn’t get around to use it for anything. So I am ill informed.

If we ARE going to use GitHub, I should tell everyone who lack experience with it (including I) to probably learn online, whether through Youtube or just from searching.


tl:dr, I remembered Hamzah did something about separating the script, but I don't remember if it worked or not. I wanted to look for things similar to what Hamzah did but for offline. pumpkinhead, meanwhile, seems to be already ahead of me with this ai movement. So I'm taking that as reference or maybe attempt to implement it...

I’ll continue with my plans in the meantime… after some house work…

No, they can just reupload it, and then put it in a program.

Okay, I trust ya!

That surfaces thing I mentioned (a more technical term is a navmesh) is just to make the AI able to do complex pathfinding (e.g. reaching a platform above). I’m not sure if Peon actually pathfinds. I also did make some progress on the path finding procedure a while ago. I’ll link a file soon.

platformPathfinding.wick (11.4 KB)
(Pretty buggy though. Turn on debug mode in the “main code” frame to visualize the navmesh)

Also, if you don’t know how to use GitHub, it’s not that hard to learn. All you need to know to be able to contribute is how to commit, which can be done on the website by dragging files and then writing the commit message. I’d recommend downloading GitHub Desktop since it will automatically detect what files have changed when you commit.

1 Like
You COULD read this... but this is mostly me complaining about being stumped yesterday. and some Gifs of me messing around because I couldn't think of a solution. It may or may not help.

So I am stumped. Peon is not detected by the ground I’m going to keep trying, but I am not sure where to look to fix it.

new things:

  • I made sure that I put all relevant objects-in-arrays inside a master array during platform update. it sorta worked for the enemy (it printed out at the console but then stopped colliding). It consistently collides with the wall though… and with the floor when the gravity is small enough… but otherwise it still just moves through the wall and floor.
Bunch of gifs I made while trying to figure out where to look. all of it is unhelpful. kept here for ideas...

gravity low enough for the platform to detect enemy
gravity low but slightly stronger. same speed, maybe.
horizontal speed is very slow (at 0.1), but still detectable
moderate horizontal speed (maybe 5 i think?). still detected.
at 10 units but still detectable.
at 30 units. still detected.

at 50 units the plane stopped being detected by the platform…


I’m still lost. remembered that i have a hit function. checked to see if it could stick itself to the player. it did. it stayed stuck on the player 2… rip.

I also checked if it could stick to the platforms. It couldnt. I checked and apparently I forgot to have the enemy update include the platforms. it could stick to platforms.

it’s weird how it doesn’t do anything unless it is a particular velocity…

  • I started using the hits function, and it seems to be something that I was going for. Didn’t exactly explain why the platformUpdate function stops detecting Peon.

So far I was only able to make a badly executed peon. I couldn’t figure out why the platformUpdate function is not detecting Peon so I opted for a crude solution for now. The solution is mostly just the enemy checking if it is colliding with the walls with the hits function and checking the type of platform.

I was able to confirm using the console.log() that it detect Peon just once when hitting a floors certain velocity and colliding with walls below a certain speed, but otherwise it still falls through and past the blocks and gates. the lag may or may not be causing variable results. Next step for me is to make it jump over walls shorter than her. I’ll figure out later, but for now I want to ask for help to why peon is only being detected once.

image
I was hoping that with this the enemies that collide with the platforms would react like the player clips would. It didn’t exactly do that…

(still a wip… you can take a look at the test arena.)

FFR 1.5.1 - WIP6-24-2022_10-29-38.wick (2.7 MB)

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…