It is currently 27 Apr 2024, 17:59
   
Text Size

Food token crash the game,help!

Moderator: CCGHQ Admins

Food token crash the game,help!

Postby steamchicken » 01 Jan 2024, 17:34

I'm from China and new here,so maybe I cannot describe this problem correctly.But I really need your help.
I play with the version Etphonehome uploaded in July.I believe it’s the lastest one.
When I play some card which createing food token,it works.
Sacrifices food token to gain life,when I do it first time in a game,also works perfectly.Do it second time,the game crash in a high probability.Sometimes dont,but still happen if I keep sacrificing food token.
Use Oko, Thief of Crowns,turn a food token into an elk,when the food elk die,the game crash.It’s quite weird.
When game crash,some sentences like “0x0078fdfa 0x000000c4 cannot be read” appares..
I checked the code of all four food token,it seems no mistake. Actually I played the another version,uploaded in 2019.In that version,food token dont crash the game.
So,I dont know what to do now.Is there anything wrong with my computer?
Please help me.
steamchicken
 
Posts: 4
Joined: 01 Jan 2024, 16:47
Has thanked: 1 time
Been thanked: 1 time

Re: Food token crash the game,help!

Postby etphonehome » 01 Jan 2024, 21:30

HI

Planeswalkersdon't work properly in this game version (and some other stuff too). If you wanna play with Planeswalkers properly i recommend youto try Forge. They work properly. The Pseudo-AI is a bit stupid, but if you fight against pre-made decks you may have some fight to remember.
etphonehome
 
Posts: 299
Joined: 21 May 2020, 12:50
Has thanked: 270 times
Been thanked: 39 times

Re: Food token crash the game,help!

Postby steamchicken » 02 Jan 2024, 07:16

etphonehome wrote:HI

Planeswalkersdon't work properly in this game version (and some other stuff too). If you wanna play with Planeswalkers properly i recommend youto try Forge. They work properly. The Pseudo-AI is a bit stupid, but if you fight against pre-made decks you may have some fight to remember.
Actually planeswalkers work quite fine.There are problems with some planswalkers but most of them work,including Oko.
The real problem is food token.Maybe you can read this again?
steamchicken
 
Posts: 4
Joined: 01 Jan 2024, 16:47
Has thanked: 1 time
Been thanked: 1 time

Re: Food token crash the game,help!

Postby etphonehome » 02 Jan 2024, 15:42

hi

They look like they work fine, and usually they seem to work, at least the abilities they have.

As far as i know, they are not really "planeswalkers", they are enchantments disguised as Planeswalkers.

You never choose a Planeswalker to attack, you choose a player, and that damage is redirected to the planeswalker.

This lead to stupid AI decisions, like:

All Out To Attack Planeswalker Example.jpg


All Out To Attack Planeswalker Example 2.jpg


Planeswalker has 2 loyalty counters,so it only needs 2 damage to die, but AI attacked full force to deal 11 points of damage. It ignored the Player (you) completely.

Also when trying to targeting something that says "Enchantment", "Permanent"..., when you mouseover a card in your hand with these targets, reduces your game framerate a lot.

The Monarch, City's Blessing, Vanguards, Emblems, Planeswalkers... are indeed enchantments. And to make them work, new functions had to be created, but those functions reduce the game framerate a lot and probably the AI quality also.

Cards with energy counters don't work and they lag your game even worse than filtering Enchantments. Well, they work for you but AI don't seem to use them.

And this game still has hundreds/thousands cards badly/improperly coded.

I stopped sharing "My Version" of the game, because instead of remaking the game, i'm "demaking" the game.

I want a game that i can a a decent fight against an AI.

I also use forge because it has all the cards properly supported, but i keep coming back to DOTP2014 because i don't feel i'm having a duel against an AI. Just a game against some pre-defined rules as an AI.

Now, i'm just using cards in my version of the game that work properly, so i removed all the support for pseudo-enchantments support, like Planeswalkers.

I've rewrite the code for cards using energy counters and as far as it goes it seems to work and no lags and framerate drops.
Rewrite the code for City's blessing...
etphonehome
 
Posts: 299
Joined: 21 May 2020, 12:50
Has thanked: 270 times
Been thanked: 39 times

Re: Food token crash the game,help!

Postby steamchicken » 02 Jan 2024, 20:25

etphonehome wrote:hi

They look like they work fine, and usually they seem to work, at least the abilities they have.

As far as i know, they are not really "planeswalkers", they are enchantments disguised as Planeswalkers.

You never choose a Planeswalker to attack, you choose a player, and that damage is redirected to the planeswalker.

This lead to stupid AI decisions, like:

All Out To Attack Planeswalker Example.jpg


All Out To Attack Planeswalker Example 2.jpg


Planeswalker has 2 loyalty counters,so it only needs 2 damage to die, but AI attacked full force to deal 11 points of damage. It ignored the Player (you) completely.

Also when trying to targeting something that says "Enchantment", "Permanent"..., when you mouseover a card in your hand with these targets, reduces your game framerate a lot.

The Monarch, City's Blessing, Vanguards, Emblems, Planeswalkers... are indeed enchantments. And to make them work, new functions had to be created, but those functions reduce the game framerate a lot and probably the AI quality also.

Cards with energy counters don't work and they lag your game even worse than filtering Enchantments. Well, they work for you but AI don't seem to use them.

And this game still has hundreds/thousands cards badly/improperly coded.

I stopped sharing "My Version" of the game, because instead of remaking the game, i'm "demaking" the game.

I want a game that i can a a decent fight against an AI.

I also use forge because it has all the cards properly supported, but i keep coming back to DOTP2014 because i don't feel i'm having a duel against an AI. Just a game against some pre-defined rules as an AI.

Now, i'm just using cards in my version of the game that work properly, so i removed all the support for pseudo-enchantments support, like Planeswalkers.

I've rewrite the code for cards using energy counters and as far as it goes it seems to work and no lags and framerate drops.
Rewrite the code for City's blessing...
Well,I understand your feeling now,a bit. You did so much hard work,quite normal to be a bit of a perfectionist.

I noticed the planewalkers problem too. Seem to work,causing various problems. For me,they are not unbearable. I can use the abilities they have,this simple thing joy me a lot. Other people gathered here must think the same as me. Thanks for your work on coding dotp2014. Maybe it hurts you,sorry I cannot do something to help.

And anyway,I solved this food token problem myself. There are four different type of food token in the code.If I create two or more of them ,put them into the battlefield,when I sacrifice them for life,the game crash.But,here is the thing,if I create only one type,it work just fine.

So I searched the FUNCTIONS in DATA_ALL_PLATFORMS,open CW_TOKENS.LOL,change the iCount of food token from 4 to 1. Now the cards only create one same food,and the game would not crash anymore. It’s not a perfect solution. But finally,I can play my favorite food deck now.

Like I say,seem to work is good enough for me. Thank you again.
steamchicken
 
Posts: 4
Joined: 01 Jan 2024, 16:47
Has thanked: 1 time
Been thanked: 1 time

Re: Food token crash the game,help!

Postby RiiakShiNal » 19 Feb 2024, 14:14

I'm looking at this thread quite late, so please forgive me if you have already found a solution.

The main problems with tokens crashing the game is usually the lack of the appropriate TOKEN_REGISTRATION on the card that created the token. Now while I haven't seen the actual code of the cards you are referring to I can generalize the issue. Say for example you have 4 "food" tokens (FOOD_TOKEN_1, FOOD_TOKEN_2, FOOD_TOKEN_3, FOOD_TOKEN_4) and a card can create any of the 4 tokens then that card must have all 4 associated TOKEN_REGISTRATIONS or it will cause crashes when it tries to clean up the tokens. So just as an example it might look something like this:
Code: Select all
<?xml version="1.0"?>
<CARD_V2 ExportVersion="3">
   <FILENAME text="FOOD_CREATING_CARD" />
   <CARDNAME text="FOODGENERATOR" />
   <TITLE>
      <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Food Generator]]></LOCALISED_TEXT>
   </TITLE>

   ...

   <TOKEN_REGISTRATION reservation="1" type="FOOD_TOKEN_1" />
   <TOKEN_REGISTRATION reservation="1" type="FOOD_TOKEN_2" />
   <TOKEN_REGISTRATION reservation="1" type="FOOD_TOKEN_3" />
   <TOKEN_REGISTRATION reservation="1" type="FOOD_TOKEN_4" />
</CARD_V2>
This still applies even if the creation and/or definition of the tokens is done inside of a LOL function file. If a card creates a token it must define the TOKEN_REGISTRATION of that token.
RiiakShiNal
Programmer
 
Posts: 2185
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times

Re: Food token crash the game,help!

Postby steamchicken » 27 Feb 2024, 14:47

RiiakShiNal wrote:I'm looking at this thread quite late, so please forgive me if you have already found a solution.

The main problems with tokens crashing the game is usually the lack of the appropriate TOKEN_REGISTRATION on the card that created the token. Now while I haven't seen the actual code of the cards you are referring to I can generalize the issue. Say for example you have 4 "food" tokens (FOOD_TOKEN_1, FOOD_TOKEN_2, FOOD_TOKEN_3, FOOD_TOKEN_4) and a card can create any of the 4 tokens then that card must have all 4 associated TOKEN_REGISTRATIONS or it will cause crashes when it tries to clean up the tokens. So just as an example it might look something like this:
Code: Select all
<?xml version="1.0"?>
<CARD_V2 ExportVersion="3">
   <FILENAME text="FOOD_CREATING_CARD" />
   <CARDNAME text="FOODGENERATOR" />
   <TITLE>
      <LOCALISED_TEXT LanguageCode="en-US"><![CDATA[Food Generator]]></LOCALISED_TEXT>
   </TITLE>

   ...

   <TOKEN_REGISTRATION reservation="1" type="FOOD_TOKEN_1" />
   <TOKEN_REGISTRATION reservation="1" type="FOOD_TOKEN_2" />
   <TOKEN_REGISTRATION reservation="1" type="FOOD_TOKEN_3" />
   <TOKEN_REGISTRATION reservation="1" type="FOOD_TOKEN_4" />
</CARD_V2>
This still applies even if the creation and/or definition of the tokens is done inside of a LOL function file. If a card creates a token it must define the TOKEN_REGISTRATION of that token.
Thank you for your reply.

Actually I checked the code of cards about food token many times. For example,Orchard Strider. The code dont seems wrong. The TOKEN_REGISTRATION are just the same as your code. And in the test they create food token just fine,all four. Maybe I should mention it at first.

As I said,game crash happen when a food token leaves the battlefield,not when I create it. I dont know why. But I find the crash dont happen if only one kind of food were created. That's why I changed the LOL function file,to make it not work as before. After that,only FOOD_TOKEN_1 will be created.

I'm still a bit curious how and why.Before I understand,maintaining the status quo would be better.
steamchicken
 
Posts: 4
Joined: 01 Jan 2024, 16:47
Has thanked: 1 time
Been thanked: 1 time

Re: Food token crash the game,help!

Postby ezpot » 01 Mar 2024, 23:27

Im a long time lurker and enjoyer of this comunity and this game, i also played every other card game out there and i agree that this one is the unique that can give decent fights against the AI.

Im specially enjoying your type 5 card althought its not perfect but its still very enjoyable to play decks with it, it only works with basic lands, if for whatever reason you create a deck with a huge number of cards it can crash the game, and some times i even played some rounds agains some AI oponents and for some unknow reason we start the game with 0 cards in hand.

And talking about things that crash the game, lets put an example your opponent has in play a creature with any counter +1/+1 , then you play solemnity enchantment and at a later turn you destroy that creature with whatever you can, it can be an instant that kill it, some of your cratures with deathtouch or even pure damage, when the creature with the counter dies the game simply crashes, theres no dump or anything it just closes itself.

I personaly think that youre not demaking the game, i really aprecciate the effort of the few ppl like you still remain there, puts in this than a decade old game, dont lose hope, continue the great work, i can say that for ppl like me and probably many many lurkers out there, that every new card coded and added to the game and we can use in our decks are a breath of fresh new air and cause real happiness.
So thank you all that worked and is still working in this game.
ezpot
 
Posts: 8
Joined: 01 Mar 2024, 22:48
Has thanked: 10 times
Been thanked: 0 time

Re: Food token crash the game,help!

Postby RiiakShiNal » 15 Apr 2024, 12:20

steamchicken wrote:Thank you for your reply.

Actually I checked the code of cards about food token many times. For example,Orchard Strider. The code dont seems wrong. The TOKEN_REGISTRATION are just the same as your code. And in the test they create food token just fine,all four. Maybe I should mention it at first.

As I said,game crash happen when a food token leaves the battlefield,not when I create it. I dont know why. But I find the crash dont happen if only one kind of food were created. That's why I changed the LOL function file,to make it not work as before. After that,only FOOD_TOKEN_1 will be created.

I'm still a bit curious how and why.Before I understand,maintaining the status quo would be better.
Cards without the TOKEN_REGISTRATION entries can still create tokens, so testing that tokens can be created does not verify that TOKEN_REGISTRATION entries are present. The TOKEN_REGISTRATION entries allow the game to know how to clean up the tokens that have been created and without them the game will crash when the match ends.

If you prefer to leave the LOL changed to only generate the 1 type of food token that is fine, I'm not going to tell you to change it. I'm just trying to explain why these types of crashes happen. Based on everything that has been said the problem is being caused because at least one of the cards that generates food tokens does not have TOKEN_REGISTRATION entries for ALL of the tokens, or it has the TOKEN_REGISTRATION entries in the wrong place (like inside of an ability tag).
RiiakShiNal
Programmer
 
Posts: 2185
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times


Return to 2014

Who is online

Users browsing this forum: No registered users and 56 guests


Who is online

In total there are 56 users online :: 0 registered, 0 hidden and 56 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 56 guests

Login Form