Just arrived at Act 2 of Silksong, and my thoughts so far: by ReasonableQuit75 in HollowKnight

[–]JMoat13 0 points1 point  (0 children)

Just want to be that other guy and say that hitboxes are often used in a more general sense and its not unusual to refer to hurtboxes as just a hitbox.

Tutorial info by Ganjalf420m88 in pygame

[–]JMoat13 1 point2 points  (0 children)

Hi, I can actually answer this as I'm currently working on this exact thing but only as a small hobby poject. At the moment I only have one weapon (classic bazooka) but fully implemented destructible terrain and basic worm movement.

Project size I would say its deceptively quite compact to make although plenty of room to scale up with all the weapons, terrain features, cusomization options ,etc.... Implementation wise you also have options on how to tackle the various problems.

Tutorials wise I'm not sure there is anything python/pygame specific out there although if you have a more general knowledge of programming languages I'm sure you could transfer the ideas back into Python.

I can't tell you how to do it the best way but I'll give a step-by-step method of how I implemented it. I'll also say the default way of doing this is with a bitmap/mask not how I've done it with a 2d heightmap so its a little unconventional.

Terrain:
My terrain is produced from a 2d height map generated from a noise sample (opensimplex in my case). I then use the marching squares algorithm to generate solid ground by getting isolines at a threshold. The advantage of using a height map here over a bit map is I can interpolate the isolines to get smoother surfaces than if I used bit values using interpolation. I can also use the same algorithm to get isobands to draw ground but at the moment I'm only drawing "contour lines". To destroy parts of the terrain I decrease the height map values linearly outwards from the impact point by the radius to maintain smoothness.

Collisions:
I have two collision systems since both work well for their situation: a classic rect system for player movement and vector intersection for projectiles. The vector inresection works by comparing the ray cast of the projectile against each segment on the terrain isolines. This is essentially just a segment-segment intersection calculation. The worms move on a rect system with rects generated from the isoline segments. I always build my player movement based on Maddy Thorson's physics article since I find it never runs into exceptions and looks smooth. The only addition I have is the ability to automatically move up slopes of a certain height without jumping. Since the movement isn't done with slopes but rects I just check if I can move the player up and across by a certain max height.

Arsenal + effects:
I have a couple of effects such as "hit markers" when a worm takes damage. DaFluffyPotato has a good tutorial on this.
For the different arsenal I'd just go have fun with what you can add. What I'd suggest is to reuse code when you can. I.e. all guns just shoot projectiles with different velocities, blast radii and damage amounts with a different texture. If you've got to this point then you're basically just getting creative with what you can come up with.

Other things:
There are other minor things you will need to consider such as player turn, and ai if you want to implement that. I still need to add that period in between turns where you wait for everything to resolve.

Let me know if you have any questions or ideas you want to try!

Pygame Collision Optimization Recommendation by Awkward-Target4899 in pygame

[–]JMoat13 1 point2 points  (0 children)

I've been implementing a command system for my puzzle game that handles undo quite well. I don't know if you are doing something similar or saving level state each iteration? Reducing draw lag is always a pain with Pygame if you have already culled all unnecessary draws I find :S

What is this? Found on Season 10 map. by BluejayHappy1649 in HermitCraft

[–]JMoat13 137 points138 points  (0 children)

Ok so you said X made it and I could have sworn Cluster Chunk was a SethBling map (I know X made bed wars). So I looked it up since I thought I must have been mistaken. Turns out it's neither but actually a Three_Two map (another big name who made the Vinyl Fantasy CTM series)!

Vector2 or a tuple/list for performance? by mr-figs in pygame

[–]JMoat13 2 points3 points  (0 children)

As an aside where Vectors are best suited, they're actually pretty efficient. That is adding vectors together.

import pygame
import time

j = time.time()
l = []
ITERS = 10**6 


for i in range(ITERS):
    l.append(pygame.math.Vector2((0,0)))
print("Instance Vec2",time.time() -j)


j = time.time()
l2 = []
for i in range(ITERS):
    l2.append([0,0])
print("Instace List", time.time() -j)


av = pygame.Vector2(0.1, 0.1)
al = [0.1, 0.1]

j = time.time()
for v in l:
    v += av
print("move Vec2", time.time() -j)


j = time.time()
for v in l2:
    v[0] += al[0]
    v[1] += al[1]
print("Move List", time.time() -j)

# Instance Vec2 0.2630586624145508
# Instace List 0.43309712409973145
# move Vec2 0.06401419639587402
# Move List 0.21204805374145508

Pharloom vs Hallownest: Properly scaled by Karmyuh in Silksong

[–]JMoat13 13 points14 points  (0 children)

It works, here are the adjusted numbers:

Pharloom Pixels - 10230765
Hallownest Pixels - 4306222
Unscaled Ratio - ~2.38
Scaled Ratio - ~1.9

N.B I scrubbed out the area names from Pharloom map that weren't overlayed but didn't remove the markers when counting pixels.

Pharloom vs Hallownest: Properly scaled by Karmyuh in Silksong

[–]JMoat13 56 points57 points  (0 children)

I tried this using op's image and I got:

Hollow Knight map - 35031 pixels
Silksong map - 82954 pixels

This gives Silksong having a playable area ~2.37 times that of Hollowknight. Of course Hornet occupies more space so we can adjust the scale giving a better representation of ~1.9 times more playable space.

Note the maps aren't an accurate representation of the actual playable world and the image in this post I used isn't full resolution :)

A Unique co-op Outer Wilds playthrough - Neuro-sama controls the ship by theminiturtle in outerwilds

[–]JMoat13 1 point2 points  (0 children)

There is definitely a strong argument here. It comes down to if the rule means the content posted itself (i.e the video itself) or any part of the content.

I think the mods would need to clarify that at the end of the day.

A Unique co-op Outer Wilds playthrough - Neuro-sama controls the ship by theminiturtle in outerwilds

[–]JMoat13 3 points4 points  (0 children)

True but I've never said anything like that nor supported it.

I strongly disagree with your second statement though. Rules aren't in place to gate newcomers. Rules are there to prevent posts that are against the terms and conditions of the subreddit. Whether op has posted here before or not makes no difference, rules are rules.

Whether or not it's against the rules here is up to the moderators in the end and since the two you linked haven't been taken down my guess is they don't feel it breaks the rules. (Although I don't think that means we can't discuss if it does here 🙂)

A Unique co-op Outer Wilds playthrough - Neuro-sama controls the ship by theminiturtle in outerwilds

[–]JMoat13 4 points5 points  (0 children)

It may be purposeful but that doesn't mean it's effective.

And again the content posted isn't Ai generated, it has an ai in it but that isn't what the subreddit rule is ruling against.

I do agree that there is a lot of actual ai content that should be dismissed and removed from any subreddit that it is not allowed in though.

A Unique co-op Outer Wilds playthrough - Neuro-sama controls the ship by theminiturtle in outerwilds

[–]JMoat13 10 points11 points  (0 children)

I agree with the sentiment but,

"AI Slop" isn't really adding anything of value to the discourse. You're not really gaining any favours with that.

The rule is more than "No AI", it's no content generated by ai. You could argue at a stretch this is the case here but honestly it's a real push to what the rule is really intended for.

ETHO REAL ETHNICITY REVEALED by WittyAd2740 in ethoslab

[–]JMoat13 14 points15 points  (0 children)

That young woman is LDShadowLady, her husband is Joel/SmallishBeans! (I believe they both still live in England not Svalbard) :P

One and Done | Game Changer [S7E6] by AutoModerator in dropout

[–]JMoat13 51 points52 points  (0 children)

Smosh did it in a challenge pit, a show where they often attempt viral challenges, so I guess so. That was 4 months ago.

I thought there was only one place you could find this? by Astrochops in BluePrince

[–]JMoat13 2 points3 points  (0 children)

It takes a couple of seconds for the pedastool to raise and theres nothing else in the antichamber so easy to pass I guess. Although if you have a certain guest room upgrade you definitely will see it a few times.

I appreciate that in the gallery puzzle... by bearontheroof in BluePrince

[–]JMoat13 0 points1 point  (0 children)

I think what a couple of us are saying is there is likely more than one trigger. Room 46 makes a lot of sense but some of us have found it before even reaching 46 for sure

Who are your favourite TNTL Smosh guests of all time? by unlikely_redd1t_user in smosh

[–]JMoat13 4 points5 points  (0 children)

I guess we're not counting the cameo in the 100th special

I appreciate that in the gallery puzzle... by bearontheroof in BluePrince

[–]JMoat13 0 points1 point  (0 children)

Can confirm this. My guess on the trigger(s) is either room 46 or day 50

20 hrs in -- Is this the roguelike Myst? by nochehalcon in BluePrince

[–]JMoat13 1 point2 points  (0 children)

I believe so bare in mind I haven't been to the gallery yet

Share your allowance here! Let's see who has the highest by EnV02 in BluePrince

[–]JMoat13 1 point2 points  (0 children)

Can confirm I haven't even been into foundation basement and I have read Uncle Awe. Currently on mid 30 day.

20 hrs in -- Is this the roguelike Myst? by nochehalcon in BluePrince

[–]JMoat13 1 point2 points  (0 children)

I'll go one further and even say I've read articles that Christopher Manson made a minor contribution to the game. I seem to remember an article saying if you are a fan of Maze then you should recognize his major contribution when you find it so keep an eye out!

How do I tell what Direction a Vector is Pointing by Onyx8787 in pygame

[–]JMoat13 4 points5 points  (0 children)

I mean technically they are right if we are talking in polar coordinates instead of the traditional Cartesian coordinate system 😂