Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


What's the point in pointers?
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Discussions
View previous topic :: View next topic  
Author Message
deama1234
Master Cheater
Reputation: 3

Joined: 20 Dec 2014
Posts: 328

PostPosted: Sun Aug 30, 2015 2:40 pm    Post subject: What's the point in pointers? Reply with quote

Why can't everything be a static?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25763
Location: The netherlands

PostPosted: Sun Aug 30, 2015 2:53 pm    Post subject: Reply with quote

blame object oriented programming
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
deama1234
Master Cheater
Reputation: 3

Joined: 20 Dec 2014
Posts: 328

PostPosted: Sun Aug 30, 2015 2:59 pm    Post subject: Reply with quote

Dark Byte wrote:
blame object oriented programming

What if some other method was developed that used statics; would it be "better"? Like as in processing speed or easier/harder to read?
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Sun Aug 30, 2015 5:22 pm    Post subject: Reply with quote

If you had static addresses, then you would need to devote a memory location for the health of every NPC that will ever exist. Whether you're in the room or not. Even after you killed it, the memory would still be utilized, forever. You wouldn't be able to spawn random units. Everything would be hardcoded ahead of time.
Back to top
View user's profile Send private message
deama1234
Master Cheater
Reputation: 3

Joined: 20 Dec 2014
Posts: 328

PostPosted: Sun Aug 30, 2015 5:32 pm    Post subject: Reply with quote

Ah, I see. But couldn't you just delete those static entries? Or re-write them?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

Joined: 09 May 2003
Posts: 25763
Location: The netherlands

PostPosted: Sun Aug 30, 2015 5:35 pm    Post subject: Reply with quote

if you have 1000 NPC's, each description taking 512 bytes, it would be only 512KB RAM.
On todays systems that's practically nothing

the problem is that going through the list can be slow as opposed of having a list of nearby and alive NPC's
i guess you could keep a secondary list with pointers to alive NPC's, but then you might as well allocate and free them on the fly

(starcraft 2 does something like this)

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Gniarf
Grandmaster Cheater Supreme
Reputation: 43

Joined: 12 Mar 2012
Posts: 1285

PostPosted: Sun Aug 30, 2015 8:18 pm    Post subject: Reply with quote

deama1234 wrote:
But couldn't you just delete those static entries? Or re-write them?
You can't deallocate a static entry without unloading the exe/dll it resides in. You can overwrite it, though.

The problem with static allocation is that you're capping the maximum number of objects an array can hold, but you don't know what lies ahead in the future. It reminds me of a problem I had with deus ex:human revolution: when I started the game it would spawn 2200+ threads and just hang there. I couldn't even reach the main menu. The cause? The game creates one worker thread per core and stores their handles in a static array that can hold up to 32 handles, and immediately after they store the number of cores your computer had. Turns out my computer has 48 cores so the array was overflowing and core count was being overwritten by thread 33's handle.
By today's standard my computer is indeed abnormal, but in 10 years time having more than 32 cores might be normal, who knows.
Anyway this array should have been dynamically allocated and the point is that with static allocation sooner or later you're going to run into cases that exceed your expectations. Capping thread count would also have been a solution, but there are cases (ex: barrel count on a crysis 2 map) where capping isn't an option.

bottom line: luckily this time there was a registry entry to override detected core count, so I can pretend that I only have 32 cores.

_________________
DO NOT PM me if you want help on making/fixing/using a hack.
Back to top
View user's profile Send private message
Rydian
Grandmaster Cheater Supreme
Reputation: 31

Joined: 17 Sep 2012
Posts: 1358

PostPosted: Thu Sep 03, 2015 2:42 pm    Post subject: Reply with quote

Old games like Super Mario World can only have a specific number of entities on-screen at once because it only has a specific number of slots that entities can take up. If you have the cap (which is doable in-game purposely via spawning coins and such), new ones won't spawn. This could include things like the goal object failing to spawn if you bring too many enemies near it.
_________________
Back to top
View user's profile Send private message
finnegan waking up
How do I cheat?
Reputation: 13

Joined: 05 Aug 2014
Posts: 0

PostPosted: Thu Sep 03, 2015 3:25 pm    Post subject: Reply with quote

why do roms and emulators and console games that use cheat codes like codebreaker or actionreplay or gameshark work with the same addresses and not pointers?
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Thu Sep 03, 2015 3:28 pm    Post subject: Reply with quote

Because the code inside the game cartridge is compiled once and doesn't update?
So the emulated address of the code it basically NOPs never moves?
Back to top
View user's profile Send private message
finnegan waking up
How do I cheat?
Reputation: 13

Joined: 05 Aug 2014
Posts: 0

PostPosted: Thu Sep 03, 2015 3:32 pm    Post subject: Reply with quote

Zanzer wrote:
Because the code inside the game cartridge is compiled once and doesn't update?
So the emulated address of the code it basically NOPs never moves?


not all cheating involves nops, but yeah, i figured it'd be for that reason. i guess the coding is more primitive than some pc games.
Back to top
View user's profile Send private message
Rydian
Grandmaster Cheater Supreme
Reputation: 31

Joined: 17 Sep 2012
Posts: 1358

PostPosted: Thu Sep 03, 2015 4:41 pm    Post subject: Reply with quote

Hell, last I checked the DS/N64 were the first systems to actually have a filesystem for the games. You know, the ROM being a collection of folders and various files in it (graphics, models, sound files, text data).

All the older ROMs are literally a single blob of binary data pasted together and the game just reads from hardcoded offsets for the sound, graphics, code, etc.

_________________
Back to top
View user's profile Send private message
gir489
Grandmaster Cheater
Reputation: 14

Joined: 03 Jan 2012
Posts: 841
Location: Maryland, United States

PostPosted: Fri Sep 04, 2015 8:24 am    Post subject: Reply with quote

What's the point in having a fucking street address? When I want to ship you a package, do I just put the entire fucking house on the package?!

NO! YOU GIVE THEM A FUCKING ADDRESS TO GO TO! WHY PUTZ THE ENTIRE FUCKING CLASS AROUND ON THE STACK?! IT'S SO POINTLESS!

ALL BECAUSE SOME FUCKING DUMBASS PIECE OF SHIT FUCKING PYTHON PLEBS CAN'T UNDERSTAND THE FUCKING CONCEPT OF HEXADECIMAL COMPUTER MEMORY!

FUCK THIS PISSES ME OFF SO MUCH! GO DIE!
Back to top
View user's profile Send private message
STN
I post too much
Reputation: 43

Joined: 09 Nov 2005
Posts: 2676

PostPosted: Fri Sep 04, 2015 3:51 pm    Post subject: Reply with quote

gir489 wrote:
What's the point in having a fucking street address? When I want to ship you a package, do I just put the entire fucking house on the package?!

NO! YOU GIVE THEM A FUCKING ADDRESS TO GO TO! WHY PUTZ THE ENTIRE FUCKING CLASS AROUND ON THE STACK?! IT'S SO POINTLESS!

ALL BECAUSE SOME FUCKING DUMBASS PIECE OF SHIT FUCKING PYTHON PLEBS CAN'T UNDERSTAND THE FUCKING CONCEPT OF HEXADECIMAL COMPUTER MEMORY!

FUCK THIS PISSES ME OFF SO MUCH! GO DIE!


Calm down lol but you are totally right. Its downright impractical, object oriented programming makes life easier and to do static allocation just so people can cheat easier, why the hell would game devs do that ? Not to mention its a waste of their time and pc resources (the game would be a memory-hog as if they don't already suck at this).

I think the more important issue is why the heck do game companies not do proper Q&A and release better games than releasing these shitty broken games and patching them every hour.

PS: https://en.wikipedia.org/wiki/Memory_management#DYNAMIC

_________________
Cheat Requests/Tables- Fearless Cheat Engine
https://fearlessrevolution.com
Back to top
View user's profile Send private message
deama1234
Master Cheater
Reputation: 3

Joined: 20 Dec 2014
Posts: 328

PostPosted: Fri Sep 04, 2015 4:33 pm    Post subject: Reply with quote

Since we started talking about devs making games...

As I understand it; the old super Nintendo used cartridges, which were the same as RAM right? Kinda like a game was already compiled on some RAM and you just insert it. How viable would it be nowadays? Wouldn't compiling a game in RAM make it quicker in terms of loading? Ram can go up to like 64GB+ right?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Discussions All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites