Jump to content
  • Advertisement

mercutio604

Member
  • Content Count

    7
  • Joined

  • Last visited

Community Reputation

107 Neutral

About mercutio604

  • Rank
    Newbie

Personal Information

  • Interests
    Art
    Design
    Programming
  1. Hey guys, I was just wondering how do people allow players to inject code into your game? I never played it but I think game like screeps is what I am looking for. You can write a "script" and it will run in your game. The words "interpreter" comes into mind but no idea how that actually works. Anyway a briefer would be nice, considering I have no idea where to start this, I don't even know if its achievable for me. Not even sure what to search, thus I come to you guys. Also, not sure if its this is the correct question but even after figuring out an interpreter - one issue I am thinking I will run into is the "time used by an action" If the AI a player writes a billion nested IF loops I want it reflected in the processing time... instead of 1 frame. This is probably harder than what I can do but I would like to know, I like to learn things even if I don't complete it. OH yeah, I have dabbled in C# and Java, javascript, and python, if possible can you make the answer revolve around those? I mean I am not oppose to learning new stuff but it would be nice if I can use what I already partially know just to speed things along. It would be great if I can also use unity for this... Ideally I want it to be online multiplayer with rooms, but that is a whole another can of worms we don't have to go into right now but please make the answer compatible with a solution... Thanks If I was unclear in anything, please let me know, I will try and rephrase it.
  2. mercutio604

    When x happens - trigger y? C#

    Thank you for fast reply! So in other words I make a middleman that connects every publisher to itself and every subscriber to itself? And the middleman just "republish" everything it gets? I think I get it... Thanks
  3. How do I do title in C#? Conceptually I am thinking when an event occurs in a game, it will trigger a bunch of things watching for said occurance. Example: in a card game, I have a unit that has "whenever you play a unit this gains +1/+1". SO when I play a unit, a method in this card will get called giving it +1/+1; When researching events however, i learned that you have to subscribe to the publisher of the event (correct me if I am wrong) but this defeats the purpose?? I don't know when or where the event will come from is the issue. is there an alternate way of doing this? Or is my understanding how events work incorrect?
  4. Hi guys, Just wanted to ask if anyone have any tutorials or guides on how to make an Online Multiplayer Server-Authoritative 3D Pong. Lag compensation not necessary yet, I just want the basics. Preferably I want to use unity3d for the client. But I don't want to run a unity3d instance in the server because I don't have pro and I can't do headless mode (is that what they call it?). maybe Node.js for server, but don't know what libs/frameworks I need but certainly welcome anything that would make my life easier. The requirements of the project: 2 players/paddles move with a and d paddle is blocked by walls ball bounces off paddle and walls score keeping maybe no reset other than restart for now dedicated authoritative server (i think is what i want?) I just want a Hello World to networking and Pong seems to be the most simple that would cover the stuff I want to learn. Thanks
  5. Hi people, I was surfing the net looking for solutions and came across https://heroiclabs.com/docs/ But I can't for the life of me figure out how to make a scheduled task in it. Something like "run script x with parameters after y time" and "run script x with parameters every y time" To my understanding its suppose to be an alternative to Gamesparks and Playfab and both of those have said functionality,.. as far as I am aware. I am left assuming its not supported and I have to roll my own but then how do I do that...?
  6. mercutio604

    how to do a building timer?

    Let me make the question simpler. Since I don't seem adequately familiar with developing online multiplayer stuff does anyone know a beginners tutorial for networking? Possibly for smartfoxserver(?) + unity + mysql(?). I tried checking the networking forums but the sticky just has a broken link...
  7. mercutio604

    how to do a building timer?

    Hey guys, I just realized a solution to a game design issue that made me drop this project but found a solution that might make me pick it up again but I realized the timer solution doesn't work in my head. I mean yes I can save the due time of things and check by query if something is done but I realized I needed to check for it? The issue : Not exactly a building timer at the moment but theoretically the same. So there a game called Utopia that I am loosely basing the genre from and it has armies go on attack then have a "due back" time. This is how I had it planned out, I have a database table of cities, and a table of "out armies" which has the army, time due, and city owner. Now the issue I have is not letting every client know the army is back so much as letting the server know its back when its due. The way I see it I have 2 options, 1. run a script every min to check for every out army - sounds computation heavy and inefficient OR 2. Query the "out" armies every time someone checks the "at home" armies or similar action - which sounds a weird solution to me. Basically the army doesn't "officially get home" until someone checks for it from a client. Not to mention I have to repeatedly query the "out" armies. Although i think this is a better solution than 1. But then what if I want the attack part to happen on a timer instead of instant? By that I mean theres a march time towards the actual attack then a march to come back. Then I don't even know what will trigger the attack part. Hope I made sense ... T.T TLDR How does the database/server update itself without the client's cue it its time to do so?
  8. mercutio604

    special abilities

    When I was conceptualizing the answer for this question I had similar thinking of "building blocks" to create an ability but the question really maybe I should be asking *how* to execute it... I think (not there yet) I need to be able to write it in both C# (the client in unity) and cloudcode (the server - which i believe makes me use javascript...ive been treating it as such anyway) just a point of reference if some of the things you guys mentioned wont work in C# and javascript. "Can you provide more context on the tactics aspect?" Such as what exactly...?Maybe below would cover what you were asking not sure though. I haven't looked up the command or the valve or the nodecanvas things yet, been dealing with the networking basics atm - but wanted to reply for the time being. So far I was/am thinking something like this: Every special ability will have a damage, type, delay, range, and a special effect - possibly as a list of strings. - this will probably cover quite a number of abilities I want. they will all need a target because thats how it works in my head right now - not a design choice. If its a pure buff/debuff i can just change the damage to 0, it will go through evasion checks regardless - which i thought was kind of cool even if it just makes my life easier. Every special effect I need I add on to the list, for example I need to leave a debuff. I would iterate over the list and call a function via switch case (if not the delegate thing) to apply the debuff on the target. The problem with this so far for me comes when for example the special effect needs to break the system like skip the evasion check, then I need to code in the evasion check to check the special effects for this specific effect Anyway am I going the right way at all with this? The other way I was thinking but no idea how to execute was something like: the ability would iterate a bunch of "things to do" so i have a list of "things to do" functions that can grow that combines to unique abilities. for example: "hit stun" -select a target -apply a stun effect -add self delay x or "aura buffs" -apply all allies a buff -apply self a debuff -add self delay x or "sure strike" -select a target -hit target for x damage skipping evasion check -add self delay x or "morph" -change the type of my basic attack. -add self delay x etc etc I think this is what you guys meant by "composition" but no clue how to do.
  9. Hi Clare, thanks for the reply. I still cannot get it to work with your version - 'current' shows as null I posted your version of the code as a reply in the link below. https://support.gamesparks.net/support/discussions/topics/1000084527?page=1
  10. Spark.save returns a boolean for success/failure and the below code goes through success branch. i changed the JSON formatting a bit to something i think is closer to right: if(Spark.save("characterCollection", {     "_id" : 0,     "name" : "spec1",     "hitPoints" : 5,     "movement" : 3,     "strength" : 3,     "defense" : 3,     "range" : 1,          "sprite" : "spec1",     "avatar" : "spec1"     })) {      Spark.getLog().debug("added");   } else {      Spark.getLog().debug("not added");   } var cursor = Spark.runtimeCollection("characterCollection").find(); var current = cursor.curr(); in the debugger type thingy called test harness it shows "current" as null in this version.
  11. mercutio604

    special abilities

    sorry for late reply, thanks guys. appreciate it I'll look into the command thing. @Alberth I don't think a massive amount of options is bad for perfect information games, it stops it from being solved quickly, think chess vs checkers. or shogi vs chess if your familiar. I prefer shogi > chess > checkers. In terms of balancing, I found out perfectly balanced games are not always the best route anyway despite how everyone wants it. As long as something isn't blatantly overpowered and everything is counterable it will find a continually shifting meta game ideally. again, thanks for the replies!
  12. Anyone here familiar with GameSparks? I am trying to make a collection (don't know if I am doing it right I am not well versed in JSON yet): Spark.save("characterCollection", { "characters" : [ { "id" : 1, "name" : "spec1", "hitPoints" : 5, "movement" : 3, "strength" : 3, "defense" : 3, "range" : 1, "sprite" : "spec1", "avatar" : "spec1" }, { "id" : 2, "name" : "spec2", "hitPoints" : 5, "movement" : 3, "strength" : 3, "defense" : 3, "range" : 1, "sprite" : "spec2", "avatar" : "spec2" } ] }); Then I am trying to get the data from by searching via name "spec1", again I don't know if I am doing it right not familiar with that either >.<" var characterList = Spark.metaCollection("characterCollection"); // this one works fine i think var result = Spark.metaCollection('characterCollection').findOne({"characters" :{ "name" : "spec1"}}); Spark.getLog().debug(result); // result listed as null
  13. mercutio604

    special abilities

    Hi people, Some background context: Tactics game with characters that need to execute unique special moves. I don't know if I am over thinking this but I was wondering what is the best way to code "special abilities"? I mean I could probably hard code it(maybe - haven't tried yet) but I am planning every character to have a unique ability of some kind... And I don't know how to structure it correctly. sample abilities: aoe damage, life drain, debuff added on hit, delayed attacks stun on hit snare on hit interrupt on hit aura buffs etc etc etc as oppose to a regular attack which just checks some damage against some defense. my point is the list will go as long as I can think up new abilities for new characters and I want it to simple to implement each time if possible. Any tips for a beginner like me? Thanks!
  14. mercutio604

    how to do a building timer?

    Well my original plan as was mentioned before was just a text based browser strategy game - I was only planning to use mysql php html css and javascript. I didn't actually give much thought on what else I should use should I go with the game of war like route yet I am still looking into it if I can pull it off or not. Unity was the first of the list because yes I have used it before though not much online multiplayer stuff. I figure it would get me finished the fastest regardless of what new things I need to learn for it. But I am pretty open to other things - gotta learn something somewhere no matter what anyway. Thanks for letting me know of these~
  15. mercutio604

    how to do a building timer?

    Well I guess I can have the server send back with the elapsed time as part of the formula, a few seconds isnt a deal breaker though...As long as the DB has the correct state and the client is close enough. Unless maybe the client finishes early in which case users will be wondering why something isnt working if it relies on said building. I guess I can also send a "r u done" check after the client is done so they can agree on it. Either way if the client finishes early, the user is left with a "uh whats happening" scenario :(   thats why I said instead of...no? or did I misunderstand your point?   Thanks for your patience with me :D Also I just reread your post I just realized I don\t really need the start time, just the end time.
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!