Castle Paradox Forum Index Castle Paradox

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Gamelist   Review List   Song List   All Journals   Site Stats   Search Gamelist   IRC Chat Room

OHRRPGCE for graphical environments.
Goto page Previous  1, 2, 3
 
Post new topic   Reply to topic    Castle Paradox Forum Index -> The Arcade
View previous topic :: View next topic  
Author Message
phyrfox
Avid Player




Joined: 20 Feb 2005
Posts: 96
Location: New York, USA

PostPosted: Sun Feb 27, 2005 3:31 pm    Post subject: Weekly update Reply with quote

Alright. Here's this week's updates.

Progress is moving. Working 11 hours a day means I can only spend weekend days to seriously program, the rest of the time is just an hour here and an hour there. So, what has been accomplished this week?

Research on SDL and various other things have occupied a portion of time, debugging a few elusive glitches a bit more time, and the rest creating structures and code to manipulate these structures. Actual engine does not do anything yet, but that will be easy to implement when I know all is well with memory control.

Roughly 700 lines of code exist at the time of this posting (should be over 1000 or so by the time I retire tonight); most of this code are structures and things that will be used. A RPG-loading routine is in the works in two parts: one to load an entire RPG, and one just to index an RPG so it can be indexed with file pointers. Now to make the rest of the structures need to be implemented so they can be handled in memory.

Here comes the tricky part; I'm still debating between loading the entire file into RAM, or just using a load-on-demand feature. Load-on-demand can be implemented with my current code; the only difference between the two is that the file in RAM would be read faster. Either way, there's going to be a set amount of memory for "in-use" structures. I would guess that in-use structures will probably require around 1-2MB, so the primary question here is "speed versus memory usage." I think I'm going to write a bunch of load-on-demand functions that can be plugged into either a file or RAM buffer, thus it will be accessable which mode is used in the menu system.

~= phyrfox =~
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
jabbercat
Composer




Joined: 04 Sep 2003
Posts: 823
Location: Oxford

PostPosted: Sun Feb 27, 2005 3:37 pm    Post subject: Reply with quote

These days most people don't use anything under a P3, so surely a read-on-demand couldn't be that CPU intensive. It depends wether it treats the file like a stream or not.
Back to top
View user's profile Send private message MSN Messenger
phyrfox
Avid Player




Joined: 20 Feb 2005
Posts: 96
Location: New York, USA

PostPosted: Sun Feb 27, 2005 4:23 pm    Post subject: Reply with quote

jabbercat wrote:
These days most people don't use anything under a P3, so surely a read-on-demand couldn't be that CPU intensive. It depends wether it treats the file like a stream or not.


It uses a standard file handle, actually, and it only uses fread() and fwrite() (not writing anything yet, but when it does...). I suppose I'm just keeping in mind various scenarios that could occur. Such as, keeping an open file handle all the time might be unhealthy in the event of a crash. Or what happens when you lock the file and can't unlock it (such as the PLAYING.TMP error you get sometimes when Windows crashes your game and you have to restart or delete the file in DOS mode or something annoying like that). I guess it doesn't matter too much. Editing the file will probably require loading the entire thing in memory, resizing the file, then writing it back. It beats unlumping the file and then re-lumping it later.

So... load-on-demand for playing, and a load-to-RAM for editing. That's a reasonable method.... I think. What do you think?

~= phyrfox =~
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
jabbercat
Composer




Joined: 04 Sep 2003
Posts: 823
Location: Oxford

PostPosted: Mon Feb 28, 2005 1:50 am    Post subject: Reply with quote

fread and fwrite? Don't you like streams? Raspberry!

I can't see any problem using the same method that the OHR uses for reading the lump. Ofcourse one way to get around that problem is placing the temp folder in the same folder as the engine. That should sort it, right?

Out of interest, what compiler are you using?
Back to top
View user's profile Send private message MSN Messenger
phyrfox
Avid Player




Joined: 20 Feb 2005
Posts: 96
Location: New York, USA

PostPosted: Mon Feb 28, 2005 2:05 am    Post subject: Reply with quote

jabbercat wrote:
fread and fwrite? Don't you like streams? :P


I do normally, except this is all binary data anyway, and so I'd be using the streams' fread/write commands anyway. Even using the line input commands for a string seem to "break" easily, so I just stuck with reading one char at a time and stopping at the first NULL character I come across. It helps with making sure my file pointer is exactly where I want it to be. And the difference in code size isn't that great anyway.

jabbercat wrote:
I can't see any problem using the same method that the OHR uses for reading the lump. Ofcourse one way to get around that problem is placing the temp folder in the same folder as the engine. That should sort it, right?


I would imagine I'd actually want to open the directory in the user's home folder if at all possible, to avoid multiple users locking other users out. It's overkill, but I'm presuming at least one person somewhere is going to get it into his or her mind to put it on a network drive that is accessable by siblings or friends, and run into a locking scenario. Besides, it's more "responsible" for the program to minimize the chance of data loss by accessing the file no more often than necessary.

jabbercat wrote:

Out of interest, what compiler are you using?


For this build, since I'm stuck in Linux, I'm using gcc 3.3.3 (SuSE Linux) under the POSIX threading model, which is the most up to date version of gcc available for SuSE. When I get to Windows again, I'll be using gcc or MingW with either Quincy or Bloodshed Dev-C++.

~= phyrfox =~
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
jabbercat
Composer




Joined: 04 Sep 2003
Posts: 823
Location: Oxford

PostPosted: Mon Feb 28, 2005 2:11 am    Post subject: Reply with quote

Watch-out compiling SDL_Audio with MinGW, you can get all sorts of errors.

Are you implementing OGL with the engine?
Back to top
View user's profile Send private message MSN Messenger
phyrfox
Avid Player




Joined: 20 Feb 2005
Posts: 96
Location: New York, USA

PostPosted: Mon Feb 28, 2005 3:22 am    Post subject: Reply with quote

jabbercat wrote:
Watch-out compiling SDL_Audio with MinGW, you can get all sorts of errors.


I'll keep that in mind, thanks.

jabbercat wrote:

Are you implementing OGL with the engine?


Maybe later, thanks. OGL, DX, or whatever else would be much overkill for this simple of a project; then again, if OGL provides a hardware acceleration that SDL doesn't by itself, then I might upgrade to that route, but the current (non-OGL) form I'm using now seems solidly fast enough, since SDL is designed to take advantage of hardware automatically. Then again, I might do it for some 3D effects at some point, like 3D menus or fade-into-battle effects.

~= phyrfox =~
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
jabbercat
Composer




Joined: 04 Sep 2003
Posts: 823
Location: Oxford

PostPosted: Mon Feb 28, 2005 3:31 am    Post subject: Reply with quote

I was thinking that you could use verticies with use the attack graphics as a texture and then do nice rotating and semi-transparet effects with them. Raspberry!

Embedded OGL with SDL is supported.
Back to top
View user's profile Send private message MSN Messenger
Rinku




Joined: 02 Feb 2003
Posts: 690

PostPosted: Mon Feb 28, 2005 5:11 am    Post subject: Reply with quote

"These days most people don't use anything under a P3, so surely a read-on-demand couldn't be that CPU intensive. It depends wether it treats the file like a stream or not."

while true this isn't a good argument. here's a story to illustrate:

you have 5 best friends who visit you. 1 of them is in a wheelchair. when deciding how to construct your new house, should you build a wheelchair ramp, or say 'most of my friends have legs, therefore i don't need to build it'.

it's the same issue here. sure, most people have lots of ram. i have 56mb. some ohr users, and some people who play or will play our ohr games, have less. being able to play a game with low ram is to us like a wheelchair ramp: sure, you can save time by not building it, but if a little extra effort allows everyone to be able to use it, then it's good to do it.
_________________
Tower Defense Game
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
jabbercat
Composer




Joined: 04 Sep 2003
Posts: 823
Location: Oxford

PostPosted: Mon Feb 28, 2005 5:27 am    Post subject: Reply with quote

I hate to say it, but Rinku-chan makes sence. Oookay...

I'm sure optimization can be done to get read-on-demand running smoothy though. Using registers in loops is a good start.
Back to top
View user's profile Send private message MSN Messenger
NeoTA
Idiomatic Nomenclature




Joined: 15 Mar 2004
Posts: 165

PostPosted: Mon Feb 28, 2005 6:18 am    Post subject: Reply with quote

phyrfox:
disk caching on windows should allow you to use at least 2mb of on-disk data at a time with impunity.
on linux.. it will cache the entire thing if possible!.

Have you benchmarked!?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Castle Paradox Forum Index -> The Arcade All times are GMT - 8 Hours
Goto page Previous  1, 2, 3
Page 3 of 3

 
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


Powered by phpBB © 2001, 2005 phpBB Group