-
-
Notifications
You must be signed in to change notification settings - Fork 573
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: use offsetCoordsToPx, simplify sprite coordinates #2443
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
ability.end(); | ||
|
||
const targets = getPointFacade().getCreaturesAt(arrayUtils.last(path)); | ||
// TODO: Path sometimes contains no targets. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opened an issue: #2442
@andretchen0 Not too keen at all about the idea of squishing hexagon sprites like that, it makes them kinda useless for reuse in a future 3d renderer of the game. Thinking far ahead in some ways but it's where the game is heading given time. Also, you rather corrupted those cardboards: they are now lower quality and their baked in shadows got removed. |
Dark Priests cardboards are now jaggy and lacking shadows. |
Abolished cardboard not showing up at new location after using Bonfire Spring, but snaps into new places after moving. |
Grid coordinate system (shift key or hovering round marker) are placed badly, not centered. |
Whole hexagon grid is moved around a bit. Not sure atm what to make of it, if better or worse overall. |
Uncle Fungus cardboard is placed badly, too high in X value, unlike in beta.AncientBeast.com |
Thanks for testing. Will address these or otherwise respond. |
It's your call. Fwiw, the images are tracked by Git, so nothing is lost, as long as someone remembers they're there. From my perspective, I'd be concerned about keeping my hands on copies of the original hi-dpi, hi-color-depth artwork for the monsters and environments. But the UI stuff, particularly the hex stuff, I wouldn't get overly attached to. If you switch to 3d, you'll probably either need different assets – the current hex images are small and will look blurry if there's a zoom in on the action – and there's a pretty good chance you'd just define hex geometry and then use a shader for the glowing, etc. effects. But that said, I can definitely pull out the old hexes and squish them in-game.
Sure thing. Your call.
Ah, my bad. Thanks for pointing that out. I have my programmer eyes on. ;)
With the current designs, you can't easily add them procedurally, at least not like they look with the baked in shadows. (I should say I don't know how to do this in Phaser, but with a shader ...) With a shader, in a nutshell, you'd make a copy of the monster image. Where the original is 100% opaque, make the new image replacing opaque pixels with transparent black, and skew that image. But if you skew it, it's going to look wonky, unless the feet line up on the same Y. So, that would probably be fine for a sprite like "Dark Priest". It wouldn't work for "Uncle Fungus". You could do oval-shaped old school video game shadows. |
I think I understand what you're looking for here. I've squished the type and nudged the grid position to line up with beta.ancientbeast.com. See the commit: |
Fixed in commit fix: teleport animation |
Yeah, I always keep copies and such. There's even a Mega repo linked ion the website footer with artwork and sources.
Yeah, would be better to do things like that, just like textures in 3d games basically.
At some point in the future, people will be able to play AB in cafeterias or in the park with only glasses, looking around, seeing a huge screen in front of them. So yeah, if able to simplify things, reuse, do properly and make it look good, proceed!
I was thinking that as well :)) All good, that's why it's a team effort, different expertise and points of view.
Yeah, aware the process regarding the shadow graphics. Had to do all of those manually, then skew as I've seen fit.
That's true, Uncle Fungus was problematic indeed, just like it is atm, hence I had to make new comment before.
That might fly well with some of the other future graphical modes, like pixel art. |
Ok. I'm rolling back the changes to the pngs. Will push again soon. I'll keep pushing to this branch so you can comment. But there's no sense clogging up history with a bunch of changes that get rolled back in the same refactor merge. Let me know if/when this is ready to merge and I'll open a fresh PR. |
I think this is where we are:
About the Uncle Fungus, you said
Do you mean vertically, by chance? For background: There are sprite offsets defined in
For me, this is a real stumbling block. The other information in In contrast Once there are animations, or we switch to 3d, that information is useless. For me, it just doesn't belong here. But what's more, at this point, it doesn't really need to be included in this version of the game. It's pretty common in games of this nature that there's simply a convention, e.g., the center of the image is going to be where the anchor is placed – artists can deal accordingly. If a creature's design isn't symmetrical, it's not a problem. Just pad the image on one side until the creature's midpoint is on the texture's midpoint. (Fwiw, this is what I was doing with the Priest sprite when the shadows disappeared – padding the left to move the priest's center to the right. I used GIMP, which was probably a mistake. Below, I've used Krita and things seem ok to me.) For the y, maybe we say that a texture's y-anchor is its "ground plane" and we say that's e.g., 40 pixels above its bottom row of pixels. That gives artists a little space to play with for feet. Uncle Fungus currently has 36 px of "feet": A priest has tiny feet, just 6 px: The idea would be to give all creature textures, including the ones above, the same amount of feet space. Then we can treat them all the same on the y-axis in code. That puts a bit more responsibility on the artists, but also lets them control where things end up, without needing to figure out some JSON file. Thoughts about this? If this is the last issue to be tackled for this PR and you find the other changes acceptable then I'd like to:
|
I didn't do too much testing, wanted to see if we go with this PR first and if so, to have things listed fixed first.
Yeah, my bad, meant vertically; that would be y axis in Phaser.
Yeah, sprite data shouldn't be in that file, but it was hard to deal with too many files before, so we want for it. Now it's time to push things around once again.
I figured that you were trying to tweak the Dark Priest padding. It can be done just fine in Gimp, you need to enlarge the canvas.
That's the general idea, line between feet = ground.
This actually complicates things a lot, as it would sabotage the art if not following some template overall, hence why there was some anchor variable around used in the first place.
Please no more bothering with clean history, just focus on real history and progress, showing the work process that actually went on (well, some of it, as there's always more "behind closed doors"). I'll be making curated press releases. |
This will probably require a fair amount of testing as it touches most of what gets put on screen in Phaser.
This commit streamlines grid space -> pixel space.
Otherwise:
hexGrid
, meant to show perspective. Instead scales the grid images.Hex.displayPos
. It's not needed. A grid position can be converted to the pixel position usingConst.offsetCoordsToPx()
. No need to have a handle on aHex
.Creature
:This makes it simpler to put things on screen next to creatures at various positions. Used for projectiles in this commit.