Jump to content


Photo

Setting a spell state with Weidu


  • Please log in to reply
56 replies to this topic

#21 temnix

temnix
  • Member
  • 983 posts

Posted 30 November 2017 - 01:47 PM

Is there any difference between index overflow and extra spell states?



#22 Avenger_teambg

Avenger_teambg
  • Member
  • 604 posts

Posted 30 November 2017 - 02:29 PM

Is there any difference between index overflow and extra spell states?

Yeah, the former will crash your game :)


Avenger

#23 temnix

temnix
  • Member
  • 983 posts

Posted 01 December 2017 - 01:30 PM

Which game are you referring to? Because Baldur's Gate doesn't crash. Maybe Doom or Quake or, eh, Anvil of Dawn...



#24 The Imp

The Imp

    Not good, see EVIL is better. You'll LIVE.

  • Member
  • 5148 posts

Posted 01 December 2017 - 06:14 PM

Which game are you referring to? Because Baldur's Gate doesn't crash. Maybe Doom or Quake or, eh, Anvil of Dawn...
Have you tried to define 300 identifiers to the splstate.ids file ? Cause according to Avenger_teambg, this will crash your game. And how you do that, read my second reply... there's what ~115 identifiers available. (255-128)...

Yep, Jarno Mikkola. my Mega Mod FAQ. Use of the BWS, and how to use it(scroll down that post a bit). 
OK, desert dweller, welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand. Ouh, actually it was still snow then.. but anyways.


#25 subtledoctor

subtledoctor
  • Modder
  • 656 posts

Posted 01 December 2017 - 07:35 PM

Which game are you referring to? Because Baldur's Gate doesn't crash hasn't crashed yet.

FTFY

#26 Avenger_teambg

Avenger_teambg
  • Member
  • 604 posts

Posted 02 December 2017 - 12:57 AM

Which game are you referring to? Because Baldur's Gate doesn't crash. Maybe Doom or Quake or, eh, Anvil of Dawn...
Have you tried to define 300 identifiers to the splstate.ids file ? Cause according to Avenger_teambg, this will crash your game. And how you do that, read my second reply... there's what ~115 identifiers available. (255-128)...

Nope, you can write as many entries into splstate.ids as you want. You cannot use the opcode with param2>255 without overwriting something outside the allocated memory.

Feel free to bomb your own game, but writing public mods containing this isn't encouraged. That's how malware works :D


Edited by Avenger_teambg, 02 December 2017 - 01:01 AM.

Avenger

#27 GeN1e

GeN1e

    A very GAR character

  • Modder
  • 1604 posts

Posted 02 December 2017 - 04:38 PM

This reminds me how the game would crash when equipping an item into specific slot, if there was a running script with HasSpell(Player1,SOME_INNATE) check and the innate's level was not 1.

But otherwise everything worked perfectly fine, as long as it wasn't checking for memorized spells in the items' structure.


Edited by GeN1e, 02 December 2017 - 04:39 PM.

Retired from modding.


#28 temnix

temnix
  • Member
  • 983 posts

Posted 07 December 2017 - 12:51 AM

Which game are you referring to? Because Baldur's Gate doesn't crash. Maybe Doom or Quake or, eh, Anvil of Dawn...
Have you tried to define 300 identifiers to the splstate.ids file ? Cause according to Avenger_teambg, this will crash your game. And how you do that, read my second reply... there's what ~115 identifiers available. (255-128)...

Nope, you can write as many entries into splstate.ids as you want. You cannot use the opcode with param2>255 without overwriting something outside the allocated memory.

Feel free to bomb your own game, but writing public mods containing this isn't encouraged. That's how malware works :D

 

This is quite pathetic. You wrote the code for spell states, or so you say, and you didn't even know extra states were possible. Then you made that discovery, called it sloppy coding on your own part, and now can't point a finger at anything specific that would crash. And you're talking about "encouraged" and "malware"? Leave the important words to grown-ups who stand by their shit.



#29 The Imp

The Imp

    Not good, see EVIL is better. You'll LIVE.

  • Member
  • 5148 posts

Posted 07 December 2017 - 02:35 AM

Näh, just consider that as a translation error and leave it at that ...


Yep, Jarno Mikkola. my Mega Mod FAQ. Use of the BWS, and how to use it(scroll down that post a bit). 
OK, desert dweller, welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand. Ouh, actually it was still snow then.. but anyways.


#30 subtledoctor

subtledoctor
  • Modder
  • 656 posts

Posted 07 December 2017 - 08:10 AM

Is there any difference between index overflow and extra spell states?
using the opcode with param2>255 will overwrite something outside the allocated memory.

What is not to understand here? You asked the question, he answered it.

If you get all bent out of shape by the answers to your questions, maybe the problem is with the questioner...

Edited by subtledoctor, 07 December 2017 - 08:16 AM.


#31 -Gast-

-Gast-
  • Guest

Posted 07 December 2017 - 10:48 AM

Hi, temnix!

 

     Could You please recompile your modifikation with 72 instead of 328 in the position  in question. And tell us, if this changes or not changes your mod?



#32 temnix

temnix
  • Member
  • 983 posts

Posted 08 December 2017 - 06:09 AM

Hey, Gast. I'm glad I am getting good feedback, just some useful, solid stuff in response. Maybe we can move beyond "this may crash" / "no signs of crashing." But 72 changes AI state, so how do you mean?

 

subtledoctor, if Avenger tells where there may be a crash or a problem, that would be good stuff to know. Otherwise just saying that something gets written somewhere does not equate "look out for trouble." The overwriting may be something that will never come up, or maybe it will come up and overwrite, say, SEX. Well, who cares? SEX isn't even used anywhere. But actually I've looked at the CRE file of a creature with a custom spell state, and it seems the same as before in every way, SEX and all other fields. Until there is proof of the contrary, I don't see any reason to even call this a risk. I've opened a door, let people walk through and see if there is a wolf out - and if that's enough to stay indoors.



#33 -Gast-

-Gast-
  • Guest

Posted 08 December 2017 - 07:07 AM

Hello, temnix!

 

I have no idea, what you guys are talking about. Thus my only expertise is using an old microprocessor from the seventies on machine code level. In this scenario decimal 72 is decimal 328 minus decimal 256 (2^ 8) the ninth bit you use. I am expecting, that, if a programmer asks his high-level-language for a byte-variable to use, the microprocessor will use a byte-operation to write a value into this memory location. In this case your nith bit would simply be ignored and your modification is using 72. It is a guess you can confirm or say it is changing the AI state so does not work for me and I am out. An other thing is, that transferring data in a memory location never produces an overflow in the statusregister of a microprocessor. Overflows are needing a mathematical instruction to occur (plus, minus(?), times and divide my mirroprocessor knows off as an example). I hope, I express myself clearly. 



#34 -Gast-

-Gast-
  • Guest

Posted 08 December 2017 - 07:09 AM

Joe Cool is an eight in disguise.



#35 temnix

temnix
  • Member
  • 983 posts

Posted 08 December 2017 - 11:35 AM

Hello, temnix!

 

I have no idea, what you guys are talking about. Thus my only expertise is using an old microprocessor from the seventies on machine code level. In this scenario decimal 72 is decimal 328 minus decimal 256 (2^ 8) the ninth bit you use. I am expecting, that, if a programmer asks his high-level-language for a byte-variable to use, the microprocessor will use a byte-operation to write a value into this memory location. In this case your nith bit would simply be ignored and your modification is using 72. It is a guess you can confirm or say it is changing the AI state so does not work for me and I am out. An other thing is, that transferring data in a memory location never produces an overflow in the statusregister of a microprocessor. Overflows are needing a mathematical instruction to occur (plus, minus(?), times and divide my mirroprocessor knows off as an example). I hope, I express myself clearly. 

 

No, you're wasting my time.



#36 subtledoctor

subtledoctor
  • Modder
  • 656 posts

Posted 08 December 2017 - 12:15 PM

Point is, you don't know what the effect really is, it creates a risk of problems - which may or may not ever manifest as a real problem - and you could eliminate that risk entirely by just writing the mod better. And you are, quite inanely (insanely?) refusing to do that. And I'll bet no mod you produce will ever honestly discuss such risks with would-be users. (That's the part he likened to malware btw).

I mean it would be simple to:

1] append your new state to next available spellstate slot automatically;

2] find which spellstate slot your automatic code ended up using;

3] insert that into whatever .SPL/.ITM/etc. you end up needing it in;

People have actually gone out of their way to create the means to do all that. Or hell, forget the automatic stuff, you could simply use one of the many available slots that does not amount to an index overflow. But your response is, in effect, "nah bro, I prefer my code to be shitty."

And hey, more power to you. But... why?

Edited by subtledoctor, 08 December 2017 - 12:17 PM.


#37 temnix

temnix
  • Member
  • 983 posts

Posted 09 December 2017 - 02:55 AM

Because all of those solutions come with their own limitations. What if there no next free available spell state? What if the next free slot is in excess of 255? What if I need to append twenty states for my mod? What if I don't want your lame solutions, made up because you had no real ideas, and trust players to have the courage and to understand that new approaches come with a price to pay - but so remote in this case, it's not worth mentioning...

 

See, the likes of you have never stepped out of the box. The box is your life. You think it's the universe, so you can't know what else can be out there. I mean, what's the point of talking to you, if you think, as you've said once, that these games are "murder simulators"? If that's your idea of possibilities, what are you going to do with the spells that I'm making, that take XP out of the dead, train mercenaries, send targets on geas quests? You can't have these aspirations, and pretensions, so you don't need to pay the price of discomfort for them either. I have started BG:EE just for testing thousands of times, I'm on the verge of vomiting from the Beamdog logo, but you have no idea what this may be for or about. So just go, make a spell that does 1d6 fire damage and insert a spell state in the first available hole.


Edited by temnix, 09 December 2017 - 02:56 AM.


#38 Avenger_teambg

Avenger_teambg
  • Member
  • 604 posts

Posted 09 December 2017 - 03:41 PM

Which game are you referring to? Because Baldur's Gate doesn't crash. Maybe Doom or Quake or, eh, Anvil of Dawn...
Have you tried to define 300 identifiers to the splstate.ids file ? Cause according to Avenger_teambg, this will crash your game. And how you do that, read my second reply... there's what ~115 identifiers available. (255-128)...

Nope, you can write as many entries into splstate.ids as you want. You cannot use the opcode with param2>255 without overwriting something outside the allocated memory.

Feel free to bomb your own game, but writing public mods containing this isn't encouraged. That's how malware works :D

 

This is quite pathetic. You wrote the code for spell states, or so you say, and you didn't even know extra states were possible. Then you made that discovery, called it sloppy coding on your own part, and now can't point a finger at anything specific that would crash. And you're talking about "encouraged" and "malware"? Leave the important words to grown-ups who stand by their shit.

 

Temnix, i'm terribly sorry that i had to rain on your parade, really. Still, you have to contend with the 256 states given to you.

 

"This is quite pathetic." Pot, kettle, black

"You wrote the code for spell states, or so you say, and you didn't even know extra states were possible. " i know they are not possible in a safe way, i didn't know they could slip past the safeguard i wrote.

"Then you made that discovery, called it sloppy coding on your own part, and now can't point a finger at anything specific that would crash."  I checked the code, and noticed that the safeguards that would prevent memory overwriting don't exist in released code (asserts work only in debug). Admitted, it is sloppy. I could point my finger at anything specific that would crash, but i'm not going to waste time on writing exploits. 

'And you're talking about "encouraged" and "malware"?' malware is a program that causes intentional harm. Since you know about it, i just told you, if you crash someone's computer with your half-assed spell states, you wrote malware. And i'm not encouraging you. In fact, i try everything to mitigate the problem. 

"Leave the important words to grown-ups who stand by their shit." Then grow up man. I already admitted that it is not perfect. You do the same and fix your mod. 


Avenger

#39 GeN1e

GeN1e

    A very GAR character

  • Modder
  • 1604 posts

Posted 09 December 2017 - 05:44 PM

Otherwise just saying that something gets written somewhere does not equate "look out for trouble." The overwriting may be something that will never come up, or maybe it will come up and overwrite, say, SEX.

Or it may crash the game if you equip any item in the ring slot, but only if the area script is checking whether you have a specific innate spell memorized...

 

SEX isn't even used anywhere.

I'm pretty sure it determines male/female chant when casting spells.

 

See, the likes of you have never stepped out of the box. The box is your life. You think it's the universe, so you can't know what else can be out there. I mean, what's the point of talking to you, if you think, as you've said once, that these games are "murder simulators"? If that's your idea of possibilities, what are you going to do with the spells that I'm making, that take XP out of the dead, train mercenaries, send targets on geas quests?

I hate to be the wet blanket, but it applies to yourself more than to anyone else in this thread.

See, this game wasn't made for the many things you'd like to be in it. As in, the engine simply doesn't have the necessary functionality to carry out your ideas. Sure, I guess you can work around some of it with various ugly hacks, but it's akin to hammering nails with a microscope - can be done, but usually you just go and buy the damn hammer. Or, in this case, grab a better engine and make a new game with all the blackjack and hookers.


Edited by GeN1e, 09 December 2017 - 05:47 PM.

Retired from modding.


#40 temnix

temnix
  • Member
  • 983 posts

Posted 11 December 2017 - 01:11 AM

Doesn't have the functionality? Ajantis, I AM making those things. In case you've been looking into your navel for the last year instead of at my ideas, all of which have worked, or I withdrew them. But you've been helpful to me, so let me give you an example. Does this game has time travel? Its spells, I mean? Well, there is Time Stop, but does it have some way to move characters, for example, forward through time? You are going to say, no. But it does. It's called AdvanceTime(). That is a script action no half-wits had the other half to experiment with - otherwise, where are their results? But I have, and I know what it does to running spell durations and other things. More important, I have the imagination to see that action as a way to implement time travel. Sure, it was not "meant to be" used this way. Stones were not meant to be tied to sticks. Cave men should have just waited for God to give them another engine, where tools grow on trees. Or maybe they should have made a better world themselves? Oh, sorry, they couldn't. Any more than you or me or any one of us here can make an engine that would both be sophisticated and come with the art and form and music of the old games. There are all sorts of indie games out there, ugly and primitive as butt. I do NOT want a crappy experience like that, and there are NO modern RPG engines that come off well. Except Skyrim, which has its own issues. But these games and tools are what we are stuck with.

 

I know you're erudite enough when it comes to the engine. But it takes more than that to make something interesting. And if you only have the mental scope to play with the givens, if your idea of a mod is "tweak Fireball" or "add another kit," then go ahead and enjoy those meager delights. I'm going to make my wonders that will make jaws drop. And sure, there is a price to pay.