[XP] Advance Wars Engine

Started by KK20, November 20, 2012, 08:51:57 pm

Previous topic - Next topic

Gears

Then the problem must be on my side. I cannot get the variations to work. I might have to put some additional thought into it.

KK20

Well it's about time I post something to this topic again. I finally decided to just put the project onto GitHub and truly make it open source. I'll most likely find a way to extract the scripts and put them in separate text files as soon as I find a reliable way to load them back into RMXP.

The repository can be found here: https://github.com/tcrane20/AdvanceWarsEngine

So yeah, have fun with the current (somewhat buggy) build that I have been working on and off for nearly 3 years.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Eliwan

Having been trudging with this since March; I have found myself stuck.

In the last week, I've been trying to replicate HPD's Zed; but I got rather stuck. First I made a list of what I need to check from the CO's units; and added what I knew was needed:

I. Turn unit was produced (done)
II. Unit's X and Y position at turn start (done)
III. Unit's HP, Fuel, and Ammo at turn start [for SCOP] (done)
IV. If the unit was loaded at turn start (done)
V. What unit the unit was loaded in at turn start (maybe not necessary)
VI. What units the unit has loaded in it at turn start, and 1-5 for these units (done)

And what I need the power method to execute:

1. Un-produce all units that were produced this turn (destroy unit and add funds equal to the unit's price). (fully functional)
2. Revert all unit's X/Y positions to turn start. (mostly functional)
2a/3. Any units that were loaded need their sprite un-disposed (how?!)
4. Revert all unit's HP, Fuel, and Ammo counts to turn start, refresh/un-act if SCOP (functional).
5. Re-load any units that performed unload actions
6. Delete any units that were unloaded (currently just disposes their sprite without properly removing them)

To these ends I've added a number of variables: (and of course I've also -actually added them- to the unit methods)

# Disable the units that have a disabled flag, initialize day variables
@player_turn.units.each{|u|
  u.stx = u.x
  u.sty = u.y
  u.HPD = u.health
  u.stf = u.fuel
  u.sta = u.ammo
  u.stl = u.loaded
  u.stc = u.holding_units
  if u.disabled
    u.acted = true
    u.disabled = false
  end
}

And of course for health and fuel/ammo, those are changed when the unit gets repaired or resupplied via the daily method as well (and in the daily fuel method).

I also changed unit producing to include the day that the unit gets built, and this is stored as "madeday". (by changing initialize to include day as a fourth variable; because I couldn't think of a better way that certainly exists)

And the actual method looks like this presently:

  def use_scop
super
@army.units.each{|u|
  if u.madeday == $game_map.day #if it was made this day
      u.unmake
  else #if it wasn't
      u.holding_units.each{|v| #unit(s) v that u is holding [lander]
        v.holding_units.each{|i| #unit(s) that v was holding [with an apc]
          i.x = i.stx #[that has an infantry, i guess]
          i.y = i.sty
          i.loaded = false unless i.stl
          i.fuel = i.stf
          i.ammo = i.sta
          i.health = i.HPD
          i.acted = false
          i.holding_units = i.stc
        } #i
        v.x = v.stx
        v.y = v.sty
        v.loaded = false unless v.stl
        v.fuel = v.stf
        v.ammo = v.sta
        v.health = v.HPD
        v.acted = false
        v.holding_units = v.stc
      } #v
      u.x = u.stx
      u.y = u.sty
      u.loaded = false unless u.stl
      u.fuel = u.stf
      u.ammo = u.sta
      u.health = u.HPD
      u.acted = false
      u.holding_units = u.stc
    end #made this day
    } #u
  end

[In the unit class]
  # For Zed's use, since the current destroy method isn't quite right.
  def unmake
      @army.funds += cost(true)
      @holding_units.each{|u|
        u.holding_units.each{|i| #unloads units, just in case. >_>
          i.x = i.stx
          i.y = i.sty
          if @army.scop #resets them if it's SCOP
            i.fuel = i.stf
            i.ammo = i.sta
            i.health = i.HPD
            i.acted = false
          end
        } #i
      } #u
      index = @army.units.index(self)
      @army.units[index] = nil
      $game_map.set_unit(@x,@y,nil)
      @needs_deletion = true
      @sprite.dispose
  end


But this doesn't properly do everything as lamented above in 2a/3; I can't fully figure out step 5 either.

Currently, 2a/3 is impossible for me.

5, on the other hand, works... but it leaves a ghost unit where the unit was dropped off with no sprite. >< I'm sure I missed something that I need to do but I legitimately can't figure it out.

So I'm, unfortunately, asking for help.

KK20

It's probably easier to do in the current build of the game I'm still working on. Anyways, there's a method in the Unit class called init_sprite that will probably do what you need.

For the unloaded units, you can probably do what you've been doing by adding another variable for units that holds a copy of the holding_units variable

@st_holding_units = @holding_units.clone


Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Kristoph

Do you have any plans to implement DoR COs/meter charging?  This is project is really awesome to see, good stuff

KK20

Thanks for giving my project a look :)

I wasn't a huge fan of DoR's mechanics--it didn't really give the CO's much personality and felt like the same battles being played over and over again (considering no CO had a weakness and all units were 100/100 by default). Plus, it would mean more work and a different AI to write up.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Kristoph

Yeahhh, DoR definitely felt less 'vibrant' than the other games, both in its art and in aspects of its gameplay.  What about the Vet system though?  I liked that alot since it rewarded players for keeping a unit alive longer, and you could get a nice boost after 3 kills.

I see you did include DoR units though, which is greeeeeaaat.  Especially Bikes, those alone were such an improvement, definitely one of DoR's best additions.

Also ok zeppelins????  Wowww that was the dopest custom unit ever made, super love.

KK20

The vet system is much more realistic to implement. I too like the idea, but wanted to make it a bit more interesting with a EXP type of setting. I didn't really think it was right that the last-hitting unit would be the one to get promoted (this made it harder for artillery and rockets to rank up as they are often appointed to "soften" the enemy units). It also made the strong one-hitters too powerful as well; the system does not favor the cheaper units at all, especially on larger maps and during the mid-late game.

I loved the Bike idea too. Not sure if you noticed, but I made sure they were slightly weaker than Infantry. This would, at least, give Infantry and Mechs some fighting chance against their "first-hit" advantage. Also Sami can't increase their movement either (7 move range + 1 turn capture = no friends).

Zeppelin was actually an idea I saw scattered around various boards and topics. Custom Wars was actually the one that implemented it (along with the Destroyer) so I adopted the idea into the engine. It's a pretty unique unit that's very helpful in the early-game push but falls short when Fighters and Cruisers can be mass-produced later on. The fact that it is currently the cheapest Plane-type unit also makes it great for body blocking.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Kristoph

I was big into Custom Wars back in the day; I never liked the hovercrafts or most of the custom COs, but the Zeppelin was amazingly fun.  <3

Gears

This isn't completely dead? Awesome! I'll take a look into the capabilities of this new release. See if i can come up with even more shenanigans then i did last time.

KK20

Bruh, it's only dead when I say it's dead.

You're going to have a heck of a time adjusting to some of the new changes in the code's structure. And since I'm still updating some of the key parts of the engine, I wouldn't suggest adapting your current changes over just yet. Also, enjoy running on the smoother RGSS3 :P

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Gears

It seems to run smoother indeed, but the text is all messed up and blurry. is that a bug?

KK20


Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Gears


KK20

You want to use "Advance Wars Edit", not "Advance Wars Engine v0.1b".

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

cardcafex

So wait a second, this script is getting transferred to rgss3? Oh, the things that
are possible if that's the case! :haha:

KK20

By transferred, if you mean "runs on RGSS3", then yes. It's not going to follow the same style or structure as the scripts in VXA (like how there's a Scene_Base class).
But since it runs on RGSS3, you can reference the VXA help file for newer methods introduced to some of the existing classes. My main reason for the transition is just the better performance and smoother frame rate.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

cardcafex

For some reason, the VXAXP engine lags badly on my pc, But it doesn't matter... I downloaded a zip file of the contents on github, and I was impressed anyway. I originally the old version when you first released it, but I'm going to take a look at which I want to use. Another question: Does this mean rgss3 scripts for xp?

KK20

For the most part, probably not. I don't really know of any RGSS3 scripts that I could even use (besides, I'd probably write my own). And there's a limit as to what RGSS3 scripts you can use--you're not going to have much success importing scripts meant for VXA into an XP game when the two don't have the same modular structure.

You were playing on the "Advance Wars Edit" version of the game, right? You're not using a super old computer are you?

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Tyadran

July 17, 2015, 05:45:40 pm #159 Last Edit: July 17, 2015, 06:04:07 pm by Tyadran
I hate to ask, because I feel really dumb about it, but I cannot for the life of me get Advance Wars Edit to run properly.
As retrieved from github, can someone give me a quick explanation what I need to do to get it running?  :<_<:

I'm really looking forward to using it if I can make it work.

EDIT: Should probably be more specific, I keep getting '292 scripts successfully exported.' when I try to start it.