adamz01h / wow_peggle

WoW Peggle Addon
50 stars 14 forks source link

New Levels #6

Open adamz01h opened 7 years ago

adamz01h commented 7 years ago

New Levels Since the Addon has most issues fixed. I am looking for some help creating some more levels. - Cataclysm Sulfuron Spire - Created by Andy1210

ZombieProtectionAgency commented 5 years ago

The addon appears to support an admin tool that may have been used to create levels.

I assume it was either a developer tool that was manually added or a separate addon. It would be pretty neat if we could find it or recreate it.

adamz01h commented 5 years ago

Where in the code based did you see that? Could you share that?

Andy1210 commented 5 years ago

I have decrypted the levels, I think I will try to create an editor later when I will have time :)

Andy1210 commented 5 years ago

sneek peak :) image

ZombieProtectionAgency commented 5 years ago

@adamz01h The code base makes references to a peggle editor command + object. I did some digging but I haven't been able to find a version of it online yet.

@Andy1210 That looks pretty awesome! Are you going to go simple and just give a brick selector + placement tool or are you going to wire up more advanced features like automatic lines/curves?

Andy1210 commented 5 years ago

@ZombieProtectionAgency I think the editor was only an in-house stuff at PopCap, I mean I almost sure :) I'm not sure yet how will I do the editor, automatic lines/curves would be awesome, I will try to do it :) Also I will have to deal with the animated bricks as well, which will be hard, cuz as you can see here on the top right corner: image

all the animated bricks are in the same coordinates. So I have to figure it out how to deal with them in the editor. Maybe I will need to add some kind of animation generator, and the existing ones should also be edited somehow of course. Difficult but at the end I will do it somehow :D

Andy1210 commented 5 years ago

new sneek peak image

the first version is almost ready, few days and it will be ok. (first version wont have any automatic curves/lines etc, only manual one-by-one edit)

Andy1210 commented 5 years ago

https://github.com/Andy1210/wow_peggle I will create a PR when my first custom level is done. You can try lvl 13 in the current state if you want. Be careful! I did changes to the config/game progress saving to allow us to extend the game with new levels. So if you start this new version it will reset your progress (talents/levels/scores etc) But the good news is that you can now edit the config manually, since the progress data is not encoded anymore :) Also I will share the editor in the near future (in few days), its working now, I made the lvl 13 with that. The editor is written in js with react, not a Lua addon of course :)

Andy1210 commented 5 years ago

image image

adamz01h commented 5 years ago

Awesome work on this! I was able to load the development version and the level works great! Looking forward to the level editor tool.

Andy1210 commented 5 years ago

The editor is ready. I will write a documentation or something but the basics:

  1. open the Levels.lua (thats available only in my fork, you didn't merge my PR yet, EDIT: you did merge it few minutes before I posted my comment :D)
  2. with the select background button you can open the background which should be a TARGA (TGA), because that is the one which is used by the addon. You can have only one background, so you have to open always the proper image (from the addon's images folder for the existing ones)
  3. you can create new levels, you can add every type of blocks.
  4. you can specify animations as well, there is a checkbox to preview the animations (its turned off by default)
  5. the animations are not really straight forward to handle, but if you try the options, you will see how will it look like. Its using the same logic/calculations etc what is used by the game, so the preview is pretty accurate (except the animation speed, that is depending a bit on the performance of your computer/browser) but its not a big deal I think

shortcuts:

When you save the level, you can override the original Levels.lua. For background the game will always try to load the appropriate bg##.tga and bg##_thumb.tga, (when you put new image files, you have to restart the game, its not enough to reload the ui, I learned it after 1 hour of struggling with it :D)

So basically other than putting two tga images to the images folder and saving the Levels.lua file, you don't have to do anything else. I made the game to automatically use the new levels, we don't have to edit the game for this :)

Try it out pls, and tell me if you would like to change something, or if you have any suggestions, ideas etc.

https://peggle.andy1210.dev/

PS: oh and its automatically saving everything what you are doing in the editor to local storage, so if you refresh the page, you wont lose your progress. If you want to reset the editor by making every progress lost you have to click on the reset editor button in the bottom right corner :)

adamz01h commented 5 years ago

Playing around with it now, how/where did you get the background for Sulfuron Spire? it looks like popcap made it and fits soo well. Awesome job, im floored on how much you achieved in such a short time.

Andy1210 commented 5 years ago

My girlfriend took the screenshot in game and I just changed a bit the color of it to make it similar to the others :)

Andy1210 commented 5 years ago

We got the pictures for the future levels already :) Except for Draenor, there we don't know what should we put.

adamz01h commented 5 years ago

I got that one! image Hellfire Citadel made it from a loading screen.

adamz01h commented 5 years ago

I create a level and when I load it. Swatter reports: Date: 2019-03-31 16:53:40 ID: 1 Error occured in: Global Count: 1 Message: ..\AddOns\Peggle\Peggle.lua line 3033: attempt to concatenate field '?' (a nil value) Debug:

Peggle\Peggle.lua:3033: SpawnBrick() Peggle\Peggle.lua:1513: Peggle\Peggle.lua:1399 Peggle\Peggle.lua:6125: Peggle\Peggle.lua:612

Here is my generated Levels.lua Levels.txt

Andy1210 commented 5 years ago

Damn change the following line {69,0,1,421.1,279.6,14021,0,0,0,0,0,0}, to {69,0,1,421.1,279.6,140021,0,0,0,0,0,0},

I'm going to fix the editor in few mins :)

Andy1210 commented 5 years ago

thx for the report, I have fixed the editor. Reload the page, and then modify the rotation of the selected block from this picture from 21 to something else and then back to 21 just to save it with the correct values.

image

The rotation is set as three digits in the game, and I made the editor like that when you rotate the blocks, but I forgot to add this logic to the placement, and you probably placed the item directly as rotated to 21deg. And unfortunately the editor saved it as 21 instead of 021 :) It shouldn't happen anymore, I added this logic there as well.

Andy1210 commented 5 years ago

Also here are our level ideas (screenshots) for Pandaria, Legion, and BfA

The_Gate_of_the_Setting_Sun_Pandaria The_Wound_BfA Tomb_of_Sargeras_Legion

adamz01h commented 5 years ago

That fixed it! Is there a way to keep track of the number of bricks on a map? Official levels have like 90 - 110 pegs per map. It would be nice to track that. Otherwise great work!

Andy1210 commented 5 years ago

That's a good idea, I will add it later

adamz01h commented 5 years ago

How did you create the thumbnail for lvl 13?

Andy1210 commented 5 years ago

I tok a screenshot from the editor

Andy1210 commented 5 years ago

I have added the block counter, you can find it on the top right corner in the heading of the level :)

adamz01h commented 5 years ago

Awesome saw that got really busy with life thanks for the update. Also block "snapping" by holding control or something would be cool.