Vallar's Recent Forum Activity

  • You do not have permission to view this post

  • You might be able to accomplish this by storing a list of object positions (for things that can be destroyed or moved), a section for specific user data (for battles and trading) , and a small part to store an array of the land data (water, land, bridges, stuff that doesn't move) When the user logs in you could download everything from the database and set up "Child changed", "Child removed", and "Child added" listeners for the locations directory. That way if something is moved or changed you can update the change the graphics on the map. I also recommend putting the item name as the item type followed by a uid. An example for the locations directory:

    "locations"

    ..."user097610" <Id for user is their userid

    ......"x":0

    ......"y":0

    ..."tree190801"

    ......"x":0

    ......"y":1

    ......"other data":?

    As for displaying all this data, you could use different tilemaps, one for objects and one for terrain.

    I was thinking of something the other day but I am unsure of how practical what I am saying it is. I was thinking that perhaps on the active parts of the game (i.e. map exploration) the mutliplayer plugin would handle everything. That way I don't have to store every single piece of data related to the players in Firebase's database.

    Of course the world has to persist, in that case, when a player exits (be it through closing a tab or he just gets disconnected somehow), the game would store the relevant data in Firebase's database to be used when he logs back in.

    Wouldn't that circumvent the need to continuously store data in the database? After all the game doesn't run on a client and is hosted online just like the old RuneScape for example where you open a tab in the browser and play the game or A Dark Room. You open a tab and start playing and there is your data from the last session when you closed the tab abruptly. Although I know A Dark Room stores the data locally rather than online.

  • Are you thinking about my game Tank Trouble 2? I was talking about space arena...

    I didn't know you had another game. I only saw the space one.

    The best way to describe the game is to link it to A Dark Room really. It is a similar in concept. You have essentially a web page with multiple buttons, you click on a button that does a certain action. For example, you might have a button similar to Dark Room where you click on it to get iron for example. The button has a loading sequence that displays the time it takes to gather the iron. When it is done the iron is added to your inventory.

    However there is an exploration part where you have this world map that looks similar to this. Each square in that grid is a room (not a multiplayer room, but a location in the game) where if you click on it (or perhaps using WASD) you can move there. This means movement is grid based.

    Combat in the game happens automatically with some interaction from the user. A somewhat similar example is the combat that occurs in

    Subscribe to Construct videos now

    but you press buttons for your skills rather than type the commands.

    As for the interaction between players, it would probably be restricted to trade and chat.

    After a few hours, I was able to fix the problem where the database was inaccessible even when I was authenticated. It turned out I changed the rules on the database to Authenticated Users not public or default. Which seems to require that when I update the database or write to it to use the path "users/" "userID" to write into the database. I was only using the userID directly without the first part. So now I can write to the database using the userID specifically.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I have built my online space arena game around firebase, and I can help you create your game around it. Firebase works so well for me mainly because it's so simple. The free pricing plan is great for beginners and includes enough bandwidth for almost everything you would use it for. For your game, you could set up a custom email and password login page, then after they are signed in you can load their data from the database (using the generated userid). I haven't dealt with the custom email/password login in firebase but all of the different login methods work the same way and all can be used to get a userid. Other options for the login include: Google, Facebook, Twitter, and GitHub. After this you could sync their progress to the database periodically or however you would like the save function to work. If you would like to go this route you can find info on the firebase plugins as well as sample capx's here (just look for firebase in the list). You would need the firebase_apiv3, firebase, and firebase_authentication for a start. The other plugins are optional depending on what you want to do.

    Thanks for your reply. I have used Firebase before and was able to get the Authentication part working fine, I had a huge problem with actually getting anything written in the database based on the authentication. If I go that route, I definitely would need help in that, if you don't mind.

    The login system I created back then was based on getting an email and password from the user just like any website/forum would. It worked fine, but when I implemented a chat, it didn't work. I even got Rex's chat example and changed the API key and all that and replaced them with my own test app and it didn't work.

    Aside from that, It is daunting that I'll have to do all the syncing manually. A Dark Room has elements where you play real time controlling an "@" symbol type character through a map. Would Firebase be a good fit for that?

    I tried your game out and that is a unique idea you have there. Interesting. I saw that you have multiplayer with the "coming soon" poster. Are you working on a Firebase multiplayer?

  • I didn't use the plugin but I did a quite search and found it. As Aphrodite has said, the idea is to log the date and time when the game quits and then compare it to when the user opens the game again. Subtract both and the amount of time passed should be available. Through that you can do whatever you want.

  • Hello,

    I think your best bet would be to use Rex's plugin located here:

  • Hey guys,

    Background:

    I have been on and off working on the design for a game similar to A Dark Room; a game that is mostly text but you get to a point in the game where you have this world map that you traverse by moving around. Fighting or events are handled through stats in a turn based fashion. The multiplayer part should functions similar to Kingdom of Loathing; you login and play in your browser, no client to distribute, nothing... just login to a webpage hosting the game.

    I have also been using Construct 2 on and off for quite a while now. I have managed to read and understand the multiplayer general tutorial as well as the chat one. I tried to follow the other ones, but they felt less like tutorials and more like describing what is being done. Unfortunately, I don't get along well with these kind of tutorials so I couldn't finish them or understand much from them. I am one of those people that like hand holding at first (a detailed step by step; do that and do this with explanation) and then I am left to my own devices at the end.

    The problem

    I would like to use Construct 2 for this project instead of let's say Unity (I have used it for almost a year) as I really like using it and I can get things done MUCH faster than in Unity (I am not a coder at the end of the day). My problems are:

    • My guess is the multiplayer aspect of the game isn't done by connecting hosts to peers; you login, find a page and start playing. You can see others around you (think the old, old RuneScape but far less flashy and more primitive of course). So could I do it using Firebase only? Would it be too complicated?
    • Which framework works best with this kind of multiplayer; Photon, C2 Muliplayer or Firebase? Why?
    • Anyone knows of a tutorial that is written for idiots? I searched high and low for Photon and only found 1 that shows a setup no more. Firebase has no tutorial outside of the setup as well and C2's Multiplayer tutorial aren't step by step at all.

    What I am looking for -- not a recruiting request, trust me!

    I am looking for help really from the veterans and experts or anyone that knows well what I am talking about. I really, would like someone to put me on the correct road and have a discussion on how this can be done in the least complicated of ways. Aside from the obvious reason that I want to build this for myself, I also would like to use this as a showcase for a course I would like to teach for students in an international school. To cut the story short, I already taught a similar curriculum and I am trying a different method for motivational purposes this time.

    Thank you very much in advance and looking forward to your help and discussions.

  • I think it is to do with the size of your background and the location you reset it to. I would recommend you use a square based tiled background and set the reset location to the size of the sprite.

    This video is a step by step how to do it albeit horizontally rather than vertically:

    Subscribe to Construct videos now
  • I see, thanks for pointing out the issue. I will try to follow the tutorials you mentioned closer, sorry for the idiocy.

  • There are so many things that can go wrong with a multiplayer game it will be impossible to give you advice without a capx. It would also help if you linked the tutorial you are referencing.

    But first to confirm it's not a routing issue, are you testing locally with multiple browser windows or are you testing across a network?

    Also have you done all the official multiplayer tutorials and understood them? You will find it painfully difficult to progress otherwise.

    I am testing locally using Chrome on different tabs and incognito mode.

    As for the tutorial I am following it is

    Subscribe to Construct videos now

    . Here is the capx I have made.

    I did follow most of the tutorials that are on the website and understood them. I didn't follow every tutorial, I just followed the first 2 (the general concepts one and the chat one). That said, like I said, I am only following what the guy does in the video, step by step. Perhaps changing a few minor things. The tutorial on the website while great to explain concepts, they aren't quite good in the "step by step" department. I learn best with a "Monkey see, monkey do" approach, then let me do my own thing afterwards.

  • Bump, any ideas? I still can't solve the problem!

    Thanks!

  • You can create a variable called "objectPicker" and assign it to 0 (so it doesn't pick anything) and then when the task is done you can add an action:

    Set Value "objectPicker": int(random(1, 3))

    Then add an event below that (or perhaps a sub event, depending on your task):

    Compare Variable "objectPicker" == 1: Create object 1

    Compare Variable "objectPicker" == 2: Create obejct 2

Vallar's avatar

Vallar

Member since 24 Mar, 2014

None one is following Vallar yet!

Trophy Case

  • 10-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

14/44
How to earn trophies