Wagic 2.0 - The Revival

If you have a question about the git repository and the code, or if you have code to propose then please post in this forum.
Do not post request here.
Hasalm
Posts: 3
Joined: Fri Dec 25, 2015 4:24 am

Re: Wagic 2.0 - The Revival

Post by Hasalm » Thu May 26, 2016 12:36 am

glad to hear I'm not the only one trying to " :ugeek: :regenerate" this beast. I wish you the best of luck on your end and hope at least one of them willl be finished soon.

Bas
Posts: 383
Joined: Sat Dec 26, 2015 10:55 pm
Location: Germany

Re: Wagic 2.0 - The Revival

Post by Bas » Thu May 26, 2016 7:41 pm

Is it less work to develop a new engine than to use the existing one any fruther mid term?

I am using WTH on a PSP. Couldnt this result in the game using more memory?

if rewritten, I think it would be cool to one-click install new mods, cards, sets from a server they are hosted on (try the game free and open source game "Battle for Wesnoth" as an example)

Zethfox
Posts: 3022
Joined: Thu Jun 10, 2010 11:28 pm

Re: Wagic 2.0 - The Revival

Post by Zethfox » Fri May 27, 2016 12:35 pm

The problems i faced as a wagic dev was i literally push the source as far as i could take it. With my card coder doc and myself coding engine support, wagic went from under 2k uniques with many workarounds, to supporting over 10k uniques with very little if any workarounds.

I then recoded almost all the ai, added systems for hints, increased over all ai ability and difficulty. If you think ai is easy now, imagine how it was before i started on it.

Anyways the changes pushed the engine to a point where it couldnt even run on psp anymore.

The code has too many limitations, wagic was never coded with the idea that it was going to be this huge. Hence its seen in the code. It is difficult to add new features or change existing.

Even my abilities need a refactor, i spaghetti the code so much that change or removing something from one ability can very easily break another.

A recode of the engine is the only choice, the amount of work required to update it at this point would be more. Look at the sdl2 branch, or minimaz branch in github. Abandoned most likely becuase of what i stated.

Bas
Posts: 383
Joined: Sat Dec 26, 2015 10:55 pm
Location: Germany

Re: Wagic 2.0 - The Revival

Post by Bas » Fri May 27, 2016 3:18 pm

How you are going to avoid the same issues with a new engine, aside of modules programming?

Zethfox
Posts: 3022
Joined: Thu Jun 10, 2010 11:28 pm

Re: Wagic 2.0 - The Revival

Post by Zethfox » Sun May 29, 2016 2:29 am

breaking the engine down into part that work together, but are setup with the mentality that at any point i can remove a whole module in 5 mins and have a new one up extremely quick.

right now wagic code is much like a spiders web, we have things like cards handled 4 different ways inside the engine. rather than for example having spells instances, i prefer if a card is simply treated as a card on the stack its too hard to explain. I would have to show you how its treated 4 completely different way, yet its supposed to be a single item, instead we rebuild the same item as a guicard, a spell card, a REAL card, and weird 4th state that accesses them by thier game object element. this makes changing anything that has to do with the card a week long process of debugging to make sure we didnt break anything. but cards are not the only thing. targetchoosers are a mess too, and handling of them. mostly my fault. every target chooser needs ways to access 3 of a cards "forms", then there is zones. the code that handles zones and whats in them is all over the place. then you have things like what i faced attempting scry, where the only accessible method to move cards from thier order only changes the card map of the zone and not the order. you have 1 deck in mtg, yet the deck is in 2 places in the code, one to store cards, and one to store thier order. but why? why not find something that can store the cards AND thier order. whats the point of a split up handling there.

anyways it is as confusing as it sounds.

Djardin
Posts: 129
Joined: Sat Sep 04, 2010 11:40 am

Re: Wagic 2.0 - The Revival

Post by Djardin » Wed Jun 01, 2016 11:45 am

Zethfox wrote:A recode of the engine is the only choice, the amount of work required to update it at this point would be more. Look at the sdl2 branch, or minimaz branch in github. Abandoned most likely becuase of what i stated.
If I agree a refactor would be nice at the card engine level, I tend to disagree SDL2 or minmax branches have been abandonned because the engine is poorly designed:

SDL2 pull request was abandonned because I refused to merge a contribution that was breaking the android port. I merged it back myself into the "cmake" branch. If you try to play with this branch, you'll see that it tries to use a single build mechanism for all the ports (Windows, Linux, Mac, iOS, Android, PSP, with/without SDL2/Qt)... and as I couldn't focus on finishing this stuff, I also put inside some stuff to have an emscripten port. This emscripten port, when finished, will enable Wagic to be run in a browser. This is the branch I'm personally motivated to contribute to.

I also play with the Minmax branch from time to time. In particular, I fixed in this branch all the do/undo card code enabling to go back in time. For this branch, a simpler engine would probably help, but the main code to perform all the min-max algo is not even written...

Another important point for any active dev in the Wagic project. Please don't forget to never do major changes on the "main" branch, always do them on seperate branches, then when you're happy with the state of your dev, merge them to the main branch, or even better, ask another guy to merge your branch to the main branch while reviewing your modifications. Obviously also check the state of the continous integration and alway fix the continous integration first, then work on some functional updates.

Zethfox
Posts: 3022
Joined: Thu Jun 10, 2010 11:28 pm

Re: Wagic 2.0 - The Revival

Post by Zethfox » Wed Jun 01, 2016 12:30 pm

The recode is not actually going to be part of the wagic project, its not even going to be in a github until its in alpha state. Im testing a bunch of different paths with it, ultimately its going to be its own thing. Wagic is going to be used mostly for references on how i handled certain abilities, ect. The jge graphics engine is so deeply tied to the core that i cant reuse any of the code if i intend to switch engines, also touch events can be handled through almost all 2d libraries now, no need to hard code the zone selecror, so all that gets scrapped too.

I will most likely be focusing on android and pc with it. Unless later, much later, others port it to systems like psp. I have no intention of supporting psp.


Not sure if you understood what i said, those branchs were abandoned becuase the massive amount of work to fix the engine to a state where those branches could succeed far out weigh the benifits of adding them. Basically you need to redesign the engine just to upgrade the sdl version. Which is crazy, might as well recode the project.

Djardin
Posts: 129
Joined: Sat Sep 04, 2010 11:40 am

Re: Wagic 2.0 - The Revival

Post by Djardin » Wed Jun 01, 2016 5:54 pm

I agree the UI and game engine are a lot too entangled. However, I think that you have a misunderstanding of the current dependencies. The *cmake* branch only works with SDL2 AND uses exactly the same game engine than the "main" branch. Actually, there is not that much differences between SDL1 and SDL2... I also think that thanks to the 700+ automatic tests, it is in theory perfectly doable to un-entangle UI and game engine without breaking much.

Post Reply