1. Hey Guest, is it this your first time on the forums?

    Visit the Beginner's Box

    Introduce yourself, read some of the ins and outs of the community, access to useful links and information.

    Dismiss Notice

Bring Beta Modding To Classic

Discussion in 'General Discussion' started by Microsoft, Dec 9, 2013.

  1. Geti

    Geti Please avoid PMing me (poke a mod instead) THD Team Administrator Global Moderator

    Messages:
    3,730
    Honestly the physics side of things is the thing I am least happy with in KAG, we should have rolled our own SAT based code and used that.

    Unfortunately the decision to use box2d was made at a time when the game was literally in pieces - we could hardly test due to movement code being a terrible of the old and what eventually evolved into the new, the terrain physics being even more of a shambles than they are currently, netcode being completely non-functional one day and semi-broken the next. We needed something to fill the gap so we could fix everything else that was broken.

    The decision saved us time at that point, and everything else more or less fell into line - however, issues with box2d (synchronising contacts, dealing with desyncs without crashing everything or causing more desyncs (imagine teleporting a crate to its correct position, which now happens to be inside another crate and you're on your way), issues with joints (using box2d joints gives physical feel but another thing to sync and hell to script, current joints simpler that way but allow things to push through walls), and so on) have eaten a lot of our time anyway - these are issues we wouldn't be having with something that we'd built.

    In the end we've turned off or ignored 80% of what box2d can do due to it being too involved for a game like kag, too resource hungry, or just "not feeling right" gameplay wise. It's been akin to taking a sledge hammer to the tack you want to use to hang your picture - it works, but you end up swinging it very lightly and carefully or everything breaks.
     
  2. hierbo

    hierbo Ballista Bolt Thrower
    1. The Young Blood Collective - [YB]

    Messages:
    190
    I can imagine the troubles you've had have been extensive! A friend and I were just yesterday discussing how surprising it was that you could get box2d to work for a game like this. To be honest, I would never have guessed that's what you were using, until I saw the box2d debug messages in the server output.

    In the end, you come to a point where you're too far along to go back and start over, which is, I'm sure, where you're at now. I think you've made quite a lot out of something that is not ideally suited to your needs, and although it isn't what you would have liked to do, you can be proud of what you've done. Say what you will about programming, but it is as much an art as any other, and I have found that artists are often the harshest critics of their own work. I'm sure it doesn't help with some of the abuse you take from the community (>.>).

    What's more, you've put in some surprisingly extensive functionality into the modding elements of this game, allowing members of the community to create their own derivative works. Much of the belly-aching I see on this forum can be addressed by the source if they are willing to learn the process of making those changes, or team up with those that do. I think that if @Aphelion3371 or some other user(s) do succeed in creating a series of mods that can re-capture the gameplay, feel, and pacing of the alpha builds, you can consider that the highest form of flattery.
     
    Last edited: Dec 13, 2013
    Sir_Walter, Geti and Guitarman like this.
  3. BlueLuigi

    BlueLuigi :^) Forum Moderator Donator Tester

    Messages:
    3,620
    You foolish fool, so foolish you are.
     
    Noburu, Starsly, jackitch and 3 others like this.
  4. it did man, most builds past 190 were shit
     
    Klokinator likes this.
  5. BlueLuigi

    BlueLuigi :^) Forum Moderator Donator Tester

    Messages:
    3,620
    Yet even in beta there has been nothing as good as 190, and previous to that it's perhaps the only game I've ever played where for months at a time I (and many others) would fine it good enough to play 18~ hours a day for months.
     
    Noburu likes this.
  6. Contrary

    Contrary The Audacious Paramount of Explosive Flight Donator Tester

    Messages:
    2,196
    Hey, no one rides the 190 dick harder than me, but I play beta nearly every day and it's still fun. A little less now since beating up complete scrubs has lost its appeal but that's not a fault with the game.
     
  7. Klokinator

    Klokinator Such Beta
    1. Aphelion's Roleplay

    Messages:
    1,443
    Contrary, you should try getting really good at archer. Knights are ez mode, but mastering archer and destroying scrubs while they scream about OP ARCHERS is the greatest feeling in the world, especially when you realize how weak and pathetic the archer really is.
     
  8. BlueLuigi

    BlueLuigi :^) Forum Moderator Donator Tester

    Messages:
    3,620
    I've been playing daily too, but it's not something (and I'm not saying beta is shit I haven't found a single game that's satisfied me this way since) that I can play literally 18hours a day and not give a fuck about my time wasted. I wish I could look back and say it was just rose tinted glasses and I hated it/didn't spend that much time either, but at that point it was 3fun5me.

    One thing to keep in mind though is that's roughly 200 days after it started, and it took a lot to get there, and it was very easily ruined a few patches later, so hopefully beta gets there, the difference being if beta does, we can go back and keep it forever. 2525252525252525
     
  9. ZeldaMarioDude

    ZeldaMarioDude Tree Planter

    Messages:
    48
    I'm more used to Classic Modding.... Beta is too... new.....
    How do you add necromancer to sandbox?
     
  10. link6155

    link6155 Haxor Staff Alumni Tester Official Server Admin
    1. SharSharShar - [SHARK]

    Messages:
    534
    Buy the game? And just because something is new makes it not as good?
     
  11. BlueLuigi

    BlueLuigi :^) Forum Moderator Donator Tester

    Messages:
    3,620
    Just because it's new also doesn't make it better, your opinion you touted nearly as fact earlier quoted there would have me believe that he was poking at that notion, but who knows.
     
    Noburu, UnnamedPlayer and Kouji like this.
  12. link6155

    link6155 Haxor Staff Alumni Tester Official Server Admin
    1. SharSharShar - [SHARK]

    Messages:
    534
    Point taken. I didn't say that new things are better either. He quoted my post where I talked about it being better, which I why I assumed he meant that it wasn't as good because it was "new".
     
  13. Chrispin

    Chrispin KAG Guard Tester

    Messages:
    380
    I'm helping Rayne with his KAG Classic mod right now and I've come to the conclusion that it's damn hard to emulate classic vaulting/notching using forces without having some funky side-effects. I've gotten really close, but not good enough IMO.

    From what I can tell, Classic would determine if there was an empty space in front of your character and set your position there when you were moving. This would allow you to squeeze into tight spaces that the collision box shouldn't technically allow. This is far from impossible for me to do, but like you said it would break everything that applies a force on your character... unless there was a way to rework all forces into additive velocities, or make an easy way to convert the forces to the "new" movement system.

    So my question is...
    Is it possible for you or MM to make a new hook that triggers when a force is applied to a blob?

    It should look somewhat like this:
    void onBlobReceiveForce(CBlob@ blob, Vec2f force)

    That hook should let me take the incoming force and convert it to an additive velocity. With that I have all the info I need to plug that force into the final blob.setPosition(x, y) function for player movement.

    EDIT: I realize that this further opens up the risk of teleporting through walls at high-speed, but I can try to do a raytrace from the player's current position to the future position. If the path is blocked, then the player will just teleport to the obstacle and stop.
     
    Last edited: Mar 6, 2014
  14. Geti

    Geti Please avoid PMing me (poke a mod instead) THD Team Administrator Global Moderator

    Messages:
    3,730
    Forces are "additive velocities" at the moment, they're all applied to the velocity at the end of the frame, which is then copied across into box2d. The forces with a position are actually applied directly in box2d though and then the new velocity is taken from there, rather than the other way around, due to forces like that applying a torque as well.

    The old movement system is mutually exclusive with "proper" force based physics, but not for the reason you suggest.
    Classic simply used velocity setting/control to accomplish movement. If you walked right, your x velocity would be linearly interpolated towards about 3, or 2.5 if you were in the air, or like 1 if you were on a ladder. This happened regardless of if there was a wall there or not. The notching happened because you were "jammed" into the little notches by your x velocity, and could not "bounce off" them with proper forces because the next frame your x velocity would be set "forwards" again anyway. Jumping did a similar thing with y velocity, and the character was forced to "slide" up and over the bumpy, notchy wall. For one frame in there at least you'd be touching a "down" corner and be counted as "on ground" again, and you would jump again and again. That's how notching worked.

    Vaulting worked by deciding if you could jump or not based on some tiles around you as well as your "on ground" status (so you could jump "in the air" a little), and made notching a little smoother as a side effect as well.

    Of course, this completely destroys the idea of trampolines, boats you can stand on, etc etc - and made knocking someone away require stunning them as well, or they would just set their x and y velocity back to "normal".

    Adding a hook like that would unfortunately be terrible for performance - there's overhead for both checking if a hook exists, and a really big overhead for actually calling that hook. Blobs can receive tens or sometimes hundreds of forces each frame, and the overhead there would be completely unjusified.

    You should definitely not be using setposition to "fake" velocity when velocity is already there.
     
  15. Rayne

    Rayne ༼ つ ◕_◕ ༽つ Administrator Global Moderator Forum Moderator Tester

    Messages:
    1,916
    FWIW we've accomplished 95% classic notching and vaulting with the new addforce system Geti.
     
    Guitarman, Noburu and UnnamedPlayer like this.
  16. Beelzebub

    Beelzebub Ballista Bolt Thrower

    Messages:
    240
    shun the geti

    shun the nonbeliever

    shuuuuuuun
     
  17. ZeldaMarioDude

    ZeldaMarioDude Tree Planter

    Messages:
    48
    Bringing Beta Modding to classic means turning Classic to Beta
     
    Superblackcat likes this.
  18. Geti

    Geti Please avoid PMing me (poke a mod instead) THD Team Administrator Global Moderator

    Messages:
    3,730
    tfw classic comes to beta faster than beta will ever come to classic

    :^)
     
    BlueLuigi likes this.
  19. that face should be sad considering that people are changing your new fun game into the old one you don't like

    ur bad at making games
     
    Ozminer, Guitarman and BlueLuigi like this.
  20. Geti

    Geti Please avoid PMing me (poke a mod instead) THD Team Administrator Global Moderator

    Messages:
    3,730
    Bad is pretty subjective. The pay has been more than enough to support myself and I thoroughly enjoy most of my work. I've been a big part of making something that hundreds of thousands of people have been able to enjoy. I call that a success.

    Re: should be sad - If I let myself care about oldfags pulling the game backwards I'd be a sad man most days. The guys working on the Classic mod know me well enough to have some courtesy about what they're doing and also seem to be motivated more by a "feel" target than functional equivalence with classic, which I can respect.

    inb4 @Yagger B8 macro
     
    BlueLuigi likes this.