Jump to content

My Phaser Plugins


phreaknation
 Share

Recommended Posts

This is a list of plugins I have done and going to do in no particular order. Help support me in making plugins.

  • Dialog Manager: Dialog system that pulls scripts of dialog based on scripts.
  • Inventory Manager: Complete inventory system that manages multiple inventories.
  • Locale Manager: System for handling multiple locales.
  • "Mode7": Progress, History, Wiki. My attempt at bringing more depth to Phaser.io than your run of the mill perspectives.
  • Projectile Weapons: Various types of projectile weapons.
  • Registry Manager: Simple registry to handle the data for a game. Handles both LocalStorage, Cookies and RESTful API.
  • Selection Manager: Unit selection using html/css/js. To be updated.
  • Sprite Generator: Generate sprites via a back end, as well as saving them via the Registry Plugin via Base64 and cache.
  • Tilemap Generator: Generates a tilemap based on perlin noise.

These are ones that I plan to develop later on after I get the others stripped out.

  • Achievement Manager: TBD
  • Battle Manager: Turnbase, or Realtime battle system that handles the flow of combat.
  • Character Manager: Handles various styles of games: Platformer, Topdown, etc, and various types of entities PC, NPC, Vehicles, etc and provides reusable interactions: directional movement, jumping, attacking, etc.
  • InApp Purchases Manager: TBD
  • Notification Manager: HTML/CSS notification system.
  • Quest Manager: TBD
  • Save Manager: Handles saving/loading/deleting game states with using the Registry plugin.
  • Social Media Manager: TBD


language handler.png

selection handler.png

 

 

cover2.png

e3e1fc9afea54f702632c40467f56af5.png

Edited by phreaknation
Added Mode7 details
Link to comment
Share on other sites

Apologies there, was a type-o. Thank you for the catch. I am running around trying to get everything modularized. Currently working on setting up the language manager and getting that one all put together. If you use the registry plugin let me know how you like it and what I can do to improve it.

Link to comment
Share on other sites

Currently I am working on the Language Handler. Found out the Language Handler code disappeared so I am rewriting it currently. Should be able to release it tomorrow if things go as planned. If someone wants something over something else I can swap gears to that. I have no real set order of releases. I wanted some kind of poll thing to let people pick, but I didn't see one for the chat. Once I am done with the language stuff though I will look at the map generation stuff.

Link to comment
Share on other sites

Hey just out of curiosity, are you using the phaser isometric plugin by lewster22 on that example of the the noise map? If so, or even not so, how large is the map? Ive been trying to switch my WIP to an isometric view like that but I couldn't quite get it with the phaser isometric plugin because I have too many sprites loaded at once for it to be viable.

I tried making a tilesprite that looked isometric to match with the pieces that are actually isoSprites but I couldnt get it to match up and it was pretty buggy. Any suggestions? 

Edit: Also to piggy-back here, I too have a perlin-noise tiled map generator, but since I built it specific for my WIP it generates a 2000x2000 array, each entry with a number that corresponds with a specific kind of block. It's already packaged nicely since it builds into into a database. If anyone wants it, or if you want it, Ill be happy to drop the source. 

Link to comment
Share on other sites

Technically the map generation is infinite. I did some magic that allowed that to generate a map and allow it to continue generating. You just have to keep in mind you need to do some garbage collection on tiles outside the foreseeable camera range. Also note on that second video I pre-gen sprites and hide them so there is less lag with new sprites and they appear quickly.

Link to comment
Share on other sites

9 minutes ago, phreaknation said:

Technically the map generation is infinite. I did some magic that allowed that to generate a map and allow it to continue generating. You just have to keep in mind you need to do some garbage collection on tiles outside the foreseeable camera range. Also note on that second video I pre-gen sprites and hide them so there is less lag with new sprites and they appear quickly.

My system in a nutshell is you spawn in, client is sent data of their portion of the map, the client draws it all. Its around a 3k by 2k px draw around the player using 32x32 tiles for everything drawn (except the ground/grass which is a repeating tilesprite). Then when they walk to a point where they need to see more of the map, the server sends more map data, the old map is destroyed and the new chunks are restored. The system is really fast actually, fast enough that you cant see the flicker (but you can feel it while walking, but cant visually see it), that or I made it so that it draws the new sprites before it wipes the old lol, I dont remember its been a while since I wrote it. If you would like to see the game PM me, I would be happy to send you the ip. You need to have a steam account to login though. 

Edit: Lol, forgot why I was describing my system to begin with. I couldn't use the isometric plugin because it would still be too many sprites generated because I use small tiles. And I never got an answer, is it the phaser isometric plugin or your own system?

Link to comment
Share on other sites

I wouldnt draw everything, just a little more than what is needed. The second video shown was when I reduced the view size to inside the camera zone which I wanted to do some fog mapping to blur out what isnt rendered yet as black. Kind of more of an old school feel. Sure, would love to check it out. Mine is in pieces atm as I love making parts of the game and never get around to combining the pieces. So I ended up deciding to release some of those pieces to the world.

Link to comment
Share on other sites

I think I am done with the Language Manager. Change the name to Locale Manager as it is more semantic. Below is some output compiled from using the plugin. I also updated the registry plugin a bit. Think I am going to move on to the tilemap generator next.

 

Quote

Getting from the dictionary `You asked me and I did not say anything` in `English`. Locale set to  `en-us`
Getting from the dictionary `Du hast mich gefragt und ich hab nichts gesagt` in `Deutsche`. Locale set to  `de`

 

Link to comment
Share on other sites

Well I have made some headway on the tilemap generator. It doesn't generate the sprites or anything but rather produces the meat and potatoes you can then use to build your maps. Attached is some code to generate a grid and some test output from the console. Since this is handling x and y coords, and nothing specific to any render engine, this should work for just about anything.

Also this does not have the actual perlin generator built in but rather will allow you to use any perlin system. With that, any system used needs to have the first three parameters as x, y, z. Some systems may need to be wrapped into a function to pass this way but this allows anyone to use existing perlin libraries they have to be used.

Still needs some work and cleaning up but this is a good start. Might have it ready this weekend. Plan on making a small Phaser project to show start to end how to use this in a project.

console.log('Loading Tilemap Generator...');
genTilemap = this.game.plugins.add(PhreakNation.Plugins.TilemapGenerator);
// this should be passed from the server or stored and retreived from some kind of location.
var rndSeed = Math.floor((Math.random() * 8999) + 1000);
var perlin = genTilemap.setPerlin(Perlin, rndSeed, true);
genTilemap.setPerlinFunction(function(x, y, z) {
    // Example of passing to a function. Not actually needed for this specific library.
    return perlin.noise(x, y, z);
});
var grid = genTilemap.generateGrid(null, null, function(rand, x, y) {
    // This is where you would handle the sprite generation.
    return {
        rand: rand,
        x: x,
        y: y,
    };
}, {
    height: 4,
    width: 4,
});
console.log(grid);


472a5a838e8ecb9714648c1c56666e3d.png

Link to comment
Share on other sites

Hey, these plugins are great! I'm going to be poring through these later this week. You've also inspired me to get my ass in gear about open-sourcing my own Phaser-related stuff.

What does the sprite generator do? Like, okay, the sprite generator probably generates sprites ( ; but what problem is it solving? Why generate sprites on the server instead of in the browser?

Link to comment
Share on other sites

10 hours ago, drhayes said:

What does the sprite generator do? Like, okay, the sprite generator probably generates sprites ( ; but what problem is it solving? Why generate sprites on the server instead of in the browser?

I was making a game that was not really MMO but could be considered. The map its self for the online game would be mmo style so shared. Generating it on the back end allows me to keep the original spritesheets used private while generating hundreds of sprites with said sheet. You could totally do it on the client side but would you wouldnt want that for an online game. People would essentially run it and penises would be everywhere.

Side note, mine isnt so much open source. Free to use in private stuff but once you go public I do ask to purchase the plugin. At 4.99 and 9.99 per plugin or supporting me on Patreon to help things along. If you decide to use it in a public game without purchase I wont get all crazy about it. That on that person if they want to be an a** hat. lol

Link to comment
Share on other sites

  • 2 months later...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...