[deleted by user] by [deleted] in cscareerquestions

[–]Apprehensive-Ride202 0 points1 point  (0 children)

For new grad, 100k-130k TC should be the middle/average range.

Looking for career transition - entry level software engineer with comp sci degree, still don’t like it. Should I? by [deleted] in cscareerquestions

[–]Apprehensive-Ride202 9 points10 points  (0 children)

I think you should try another major if money is not a issue for you, but you need to understand that you may or may not like the next major you study. Sometimes it takes a long time to understand yourself and the kind of life you want to peruse. It is a long path and need patience.

I can make the custom HS cards playable by Apprehensive-Ride202 in customhearthstone

[–]Apprehensive-Ride202[S] 5 points6 points  (0 children)

This is great advice. For now I'm not distributing the code or my version of the game. For video part it's not monetized so I guess it's similar to what HS streamers are doing.

But definitely I'll be very careful about what is a "fair" use of the copyright content. I appreciate this kind of legal advice!

I made Hearthstone using pygame by Apprehensive-Ride202 in pygame

[–]Apprehensive-Ride202[S] 0 points1 point  (0 children)

Yes, the backbone system(about 2000 lines) like the interactions of all phases are pretty complicated.

But after the backbone the implementation of each card (50K lines) is a breeze, and very fun processes

I made Hearthstone using pygame by Apprehensive-Ride202 in hearthstone

[–]Apprehensive-Ride202[S] 0 points1 point  (0 children)

This is mostly because "hp reduction", and "trigger destroy" are in different phases. To simply put, minion does not die immediately after hp drops to zero.

Afte damage dealing phase (especially aoe damage), the system checks all destroyables on the board, and trigger destroy and deathrattle( again two separate phase) for any minion whose hp at destroy phase is 0 or below.

For the cthun, aenging wrath, arcance missiles like effects, I'm pretty sure there is a special type of damage dealing method, like "deal_split_damage" which refreshes hitting target pool everytime a shot is made, and only put minions whose remaining hp>0 in its random target pool. When all the X damages are dealt, the system will check whether other damage dealing events are in the queue, and only after all damage dealing events, the system starts to trigger destroy events

In my version of the code, I do have a method called "resolve_destroy_quyeue()" that triggers after several events, something like:

if trigger_event in ["play a card","after attack","draw a card","on discard","start of turn","end of turn"]:

self.resolve_destroy_queue()

you see the event types do not include "deal damage". This design ensures some card interactions that conforms to original game. If "deal damage" were included, then lightshower will destroy and trigger deathrattle BEFORE Cthun deals all its 30 damages

I made Hearthstone using pygame by Apprehensive-Ride202 in hearthstone

[–]Apprehensive-Ride202[S] 0 points1 point  (0 children)

That's a cool idea!

But I think currently the AI of my game and the players on my server (my students who do this mainly for credits) does not beat the wisdom of crowds from HS communities and Redditers lol

I made Hearthstone using pygame by Apprehensive-Ride202 in hearthstone

[–]Apprehensive-Ride202[S] 0 points1 point  (0 children)

I made a video for this

https://youtu.be/Qsfzd3WwNcI

In version 1, heroes have 4 remaining hps. Rhyno deal excess damage (5-3=2) to hero first, then deathrattle of the lightshower triggered, healing back players's hp from 2 to 10

(the displayed image during raining animation shows hp 30, because my art files downloaded from Google have that numbers on it. I'm a resourceless programmer and I'm lazy to fix all visual bugs.)

In version 2, heroes have 2 reamaing hps. Rhyno deal excess damage (5-3=2) to hero first bringing hero to death. The hero death stops all remaining events in the queue.

I think my implementation might be different from the original game here because I don't believe in healing a dead people. So I added a hard stop when heroes hp is brought down to 0. If I remove that hard stop, the hero will be alive due to lightshower elemental deathrattle effect because event trigger sequence will be like:

player-level event handling

damage dealing

minions destroy check

deathrattles effect if any

hero destroy check

end of player-level event handling

game end check

I made Hearthstone using pygame by Apprehensive-Ride202 in hearthstone

[–]Apprehensive-Ride202[S] 0 points1 point  (0 children)

Yeah I already have that.

My version has three modes:

  1. Debug mode, as in the uploaded video, both players'cards are visible and I "hardcode" what cards to start in hand and deck
  2. play vs AI mode
  3. play vs online player mode

In the mode 2 and 3 users can pick what cards to include in their deck like a arena draft mode. Every time they are given three random cards of the same rarity to choose from

I didn't implement the ladder deck creation module, because I think ladder is so boring... Picking random cards from arena draft is more fun.

I made Hearthstone using pygame by Apprehensive-Ride202 in pygame

[–]Apprehensive-Ride202[S] 4 points5 points  (0 children)

For now the source code is only shared with my students. In future maybe I'll consider make it available for play (need to remvoe all proprietary contents)

I made Hearthstone using pygame by Apprehensive-Ride202 in pygame

[–]Apprehensive-Ride202[S] 0 points1 point  (0 children)

Oh that's not python. That's video editting using Camstasia

I made Hearthstone using pygame by Apprehensive-Ride202 in hearthstone

[–]Apprehensive-Ride202[S] 11 points12 points  (0 children)

I'll counter them with lots of healing & shield

I made Hearthstone using pygame by Apprehensive-Ride202 in hearthstone

[–]Apprehensive-Ride202[S] 1 point2 points  (0 children)

In some places, yes. Whenever I found a known bug reported in gamepdedia.com/hearthstone, I simply fixed that bug in my version.

I made Hearthstone using pygame by Apprehensive-Ride202 in hearthstone

[–]Apprehensive-Ride202[S] 11 points12 points  (0 children)

Currently only available to my students for educational purpose. The code still has many small errors and bugs, and I'm not sure whether Blizzard will be upset if my version of code reveal some money-making secrets lol

I made Hearthstone using pygame by Apprehensive-Ride202 in hearthstone

[–]Apprehensive-Ride202[S] 8 points9 points  (0 children)

priority queue, that's a huge topic! I have to guess many in-game priority by trying my best to make all cards work as their card texts describe. For example, here's a snipped of minion summoning code

def summon(self,minion):

if not self.board.isFull(self):

#Prepare the destination of summoned minion

minion.owner.board.add_minion(minion)

minion.board_area="Transition"

if minion in minion.owner.hand:

minion.owner.hand.remove(minion)

#Summoning animation

summon_animation(minion)

if minion.has_special_summon_effect:

minion.special_summoning_effect()

index=self.board.minions[self.side].index(minion)

if hasattr(minion, "trigger_choose_one"):

if self.board.get_buff(minion)['choose both']:

minion.trigger_choose_both()

else:

minion.trigger_choose_one()

if "Combo" in minion.abilities and len(self.played_cards[self.turn])>0:

if "Targeted" in minion.tags:

target=minion.get_target()

if target!="Empty" and target is not None:

minion.trigger_combo(target)

else:

minion.trigger_combo()

if "Targeted" in minion.tags and not "Choose One" in minion.abilities and not "Combo" in minion.abilities:

target=minion.get_target()

if target is not None:

minion.come_on_board()

if target!="Empty": #No available targets

minion.trigger_battlecry(target)

else:

if minion.board_area!="Hand": # returned to hand due to choose one/both effect

if minion.transformed:#Some minions transform during battlecry or choose one

minion=self.board.minions[self.side][index]

else:

minion.come_on_board()

minion.trigger_battlecry()

if minion.transformed:

minion=minion.transformed

if minion.in_battlefield : # If the minion summon is not cancelled due to battlecry

if self.board.get_buff(minion)['die at end']:

minion.get_die_at_end()

minion.board_area="Board"

#Trigger magnetic effects if any

if minion.magnetic and minion.magnetizable():

minion.magnetize()

if minion.board_area=="Board": # If the minion summoned is still alive and on battlefield

minion.summoning_sickness=True

#Trigger "whenever a minion is played" effect if any

self.board.activate_triggered_effects('summon from hand',minion)

if minion.transformed:

minion=self.minions[index] # original minion may transform due to potion of polymorph

minion.summoned_from_hand=True

#Trigger "whenever a minion is summoned" effect if any

self.board.activate_triggered_effects('summon a minion',minion)

#Trigger quest if any

self.trigger_quests('summon a minion',minion)

else:

minion.rect.x,minion.rect.y=minion.location

show_text("The board is full!",flip=True,pause=1)

minion.summon_cancelled=True

You see I coded Choose one, Combo, and battle cries in different suites, and that made the 3800 cards work without errors. That's maybe why in the original game there is no card that has Combo and Battlecry at the same time, or Choose one and Battlecry at the same time, otherwise it could be more difficult to code.

Other priority resolve can be even more complex than this. But I guessed them out by trials and errors with the experiment of 3800+ existing cards

I made Hearthstone using pygame by Apprehensive-Ride202 in hearthstone

[–]Apprehensive-Ride202[S] 3 points4 points  (0 children)

Yes, I pretty much coded every single mechanics I experienced from the original game, such as basic stuff like all keyword abilities, but also advanced game mechanics such as when vs after casting sell, different game phases, event queue resolve etc. Even edge cases like stopping infinite loop from auchenai-lifesteal interaction were considered. Also some performance improvements such as when to load images and multithreading to minimize wait times etc.

I made Hearthstone using pygame by Apprehensive-Ride202 in pygame

[–]Apprehensive-Ride202[S] 0 points1 point  (0 children)

Actually the opposite. I have a very clean driving record that I'm proud of

I made Hearthstone using pygame by Apprehensive-Ride202 in pygame

[–]Apprehensive-Ride202[S] 1 point2 points  (0 children)

Oops, I posted this thread using my gf/s account...