Quote Originally Posted by jdarling
Memphis, actually under the hood objects are nothing more than a packed record with method points (VMT). By the time that you write support routines for each record type you might as well have used an object to begin with.

High speed has nothing to do with object vs method based programming. It has to do with the code optimizations you put in place and the compilers ability to optimize the output code.
lol why don't you try put that to the test, i think you will find there is a much larger overheads, using a struct you have much more control over what memory is placed where, a class you are relying on the `delphi` developers todo alot of it for you. not only is it lazy, but it is slower.

btw i develop my own programming language and an assembler atm, so i have studied alot of the ins and outs and what is going on 'under the hood'.


EDIT

take something like this

[pascal]
program Project2;

{$APPTYPE CONSOLE}

uses
Windows;

type
TSomeClass = class
temp: array[0..1023] of byte;
end;

TSomeStruct = record
temp: array[0..1023] of byte;
end;
PSomeStruct = ^TSomeStruct;

var
ss: PSomeStruct;
sc: TSomeClass;

i, v: Cardinal;
begin
v := GetTickCount;
for i := 1 to 100000 do begin
sc := TSomeClass.Create;
end;
WriteLn(GetTickCount - v);

v := GetTickCount;
for i := 1 to 100000 do begin
New(ss);
end;
WriteLn(GetTickCount - v);

sleep(2000);
end.
[/pascal]

then run it and find....

objects = 108ms
records = 47ms

and doing a loop of 500000

will give you

594 obj
454 rec

baring in mind this is after your app has used up resources, so lets switch it around and give the struct the benifit this time

[pascal]
v := GetTickCount;
for i := 1 to 500000 do begin
New(ss);
end;
WriteLn(GetTickCount - v);

v := GetTickCount;
for i := 1 to 500000 do begin
sc := TSomeClass.Create;
end;
WriteLn(GetTickCount - v);
[/pascal]

now with records:
294ms

with objects
750ms

i rest my case.


@on topic @ chesso

Quote Originally Posted by Chesso
And also something I thought about, if any given map has say 20 platforms for the player to jump on, should I process the collision check for all the platforms each frame, or rather first check if the player is anywhere near any of them (I presume the later is less intensive)? In other words some kind of management to reduce overall processing stress.
as chronzosphere said, and as you have more or less said, a bounding box is your best bet, make the bounding box bigger then the actual object/character/car etc, then once it is inside that barrier, do a "pixel perfect check" - quote

;MM;