pioneerspacesim / pioneer

A game of lonely space adventure
https://pioneerspacesim.net
1.63k stars 377 forks source link

Randomize Timer & Coding ideas (Updated) #173

Closed Valliante closed 13 years ago

Valliante commented 13 years ago

if you start off with a Basic coding sequence, for example :- (Tested on a very Basic Amstrad CPC) Rem = Reminder (Basic Code)

1 Rem *Dim Sequences, (Outer Solar System Only Planetary Positions)*** 2 Rem _Dim Sequences, (Textures & Objects)_ 3 Rem _Dim Sequences, Other Specifications_ 4 Randomize Timer (5) 5 Cls 6 Print Rnd_640 7 Print Rnd_480:Rem _Screen Dimensions, Randomize Dots Randomly On Screen_ 8 Rem _(Timer is Still Randomized at 5) and is Still Stationery_ 9 Rem **_(Timer is Not Currently Randomize Timer()) Randomized 10 Rem _So, Dot Positions would be Constantly The Same on Each Run of the Program 11 Rem _Dot Positions = Planet Positions Randomized Relative to Parent Star in Outer Solar Systems_ 12 Rem **_If you Print on Screen RND_640, and RND480 13 print "174.042021":Rem = RND_640 14 print "253.733945":Rem = RND_480 15 rem Both of the above Lines remain Constant on Each Run, and the Same unless Randomize Timer()ed.... Rem The same may be done for (A,E,I,O,U) between Letters at Relative Points for Planet Names.... Rem Also, Planet Positions Relative to Parent Star(s).... Rem Also, Textures and previous Dimmed Specifically Object(s)....

For more Info, Read Pioneer Projects Ideas i came up with that may be useful (some of them) Updated.... Thanks

Valliante commented 13 years ago

Oh, and Randomize Timer (5) can be any Prime Number which is either chosen at the Start of the Game by the Player, or Other, for Example.... :) Thanks again

Valliante commented 13 years ago

Also include at Start of Program, (Dim) for Parent Star Positions for Each Outer Solar System, Thanks

Valliante commented 13 years ago

Each Dim may also be sequenced as X,Y,Z Object or (Planet Positions) relative to Outer Solar System Parent Star(s) X,Y,Z Positions.... PSAmount=Amount of Parent Stars in the Game (Preset) For Example, Dim ParentStarX(PSAmount), ParentStarY(PSAmount), Parent Star Z(PSAmount) or Dim ParentstarAttributes(PSAmount) for Example.... then, Dim surrounding Planets, or Planetary Objects, Alien Ships etc, the same way.... Also, the Randomize Timer unless Randomize Timer()ed remains Constant when set with a Prime Number. For instance, Randomize Timer(5) for example.... Thanks

Valliante commented 13 years ago

This would remain the same for each Game when Randomize Timer is set with a Prime Number, so that Outer Solar Systems remain Constantly the Same each time the Game is Run.... The Sol System could be set as it is, or already setup at the Start of the Game.... Thanks again

robn commented 13 years ago

I'm not entirely sure what point you're trying to make here. It sounds like you might be talking about seeding galaxy/system/planet/etc generation so it appears the same on every run? That's something we already do. Are you trying to express a particular algorithm using BASIC as pseudo-code?

I suggest that you try to express your ideas in a more high-level way, with specific pointers to the parts of Pioneer that aren't currently working the way you'd like them to. If you're able feel free to submit code changes.

Valliante commented 13 years ago

it's actually for a project i'm working on, it's for loading 3D environment areas individually within a time frame without using too much computer memory.

robn commented 13 years ago

If its not relevant to Pioneer then can this issue be closed? Otherwise please make your point.

Valliante commented 13 years ago

load image "pics\background2.bmp",1

set gamma 230,230,230

load animation "vidfile.avi",1 play animation 1

place animation 1,0,120,800,480

1:

paste image 1,0,0,0

if animation playing(1)=0 or inkey$()=" "then stop animation 1:delete animation 1:goto 2

sync goto 1

rem Title

2: load sound "music\song1.wav",1

load image "pics\title1.bmp",101 load image "pics\cometmoon.bmp",102

load image "pics\copslogo.bmp",103

play sound 1 set gamma 256,256,256

cx=428:cy=548

3: cls rgb(0,0,0) paste image 101,0,0,0

set text font "arial" set text size 34

set text to bold

center text 420,148,"_Star Trek_" center text 420,188,"<>"

cx=cx+.4:cy=cy-.1 paste image 102,cx,cy,1

paste image 103,14,88,1

if sound playing(1)=0 then play sound 1

sync goto 3

rem Game

4:

cls rgb(0,0,0)

load image "objects\background\background2.bmp",1

rem Warp Effect

rem load sound "music\track1.wav",1 rem play sound 1 rem set sound volume 1,90

load object "objects\ship1.x",101 scale object 101,50,50,50

rem Sky Setup rem make object box 2,1100,1000,1000 rem texture object 2,1 rem set object cull 2,0 rem set object light 2,0

cd "objects\textures\" perform checklist for files nm=0 prog7: for t=1 to checklist quantity() file$=upper$(checklist string$(t)) ok=0 if right$(file$,4)=".BMP" then ok=1 if ok=1 then nm=nm+1:filenames$(nm)=file$ next t for t=1 to nm load image filenames$(t),200+t next t sync

cls rgb(0,0,0) position camera 0,0,0

color backdrop rgb(0,0,0)

make object sphere 1,3000 set object 1,1,0,0,0,1,0,1 set sphere mapping on 1,1 set object specular 1,0 texture object 1,1 hide object 1

make object plain 2,1024,768 set object 2,1,0,0,0,1,0,1 texture object 2,1 ghost object on 2

make object sphere 40,10 position object 40,0,0,2000 hide object 40

position object 101,0,0,800 position camera 0,0,0 set object 101,1,0,0,1,1,0,1

rem load sound "objects\warpdrive.wav",1 rem play sound 1

position camera 0,0,0 rotate camera 0,0,0

5:

if inkey$()="a" then move camera 2 if inkey$()="z" then move camera -2

if leftkey()=1 then turn camera left 1 if rightkey()=1 then turn camera right 1

if upkey()=1 then pitch camera up 2 if downkey()=1 then pitch camera down 2

position object 101,camera position x(),camera position y(),camera position z() set object to camera orientation 101 move object 101,200 set object to camera orientation 101 rem pitch object down 101,180 rem move object 101,100 rem pitch object up 101,180 pitch object down 101,90 move object 101,34 pitch object up 101,90 turn object left 101,180

position object 1,camera position x(),camera position y(),camera position z()

position object 2,camera position x(),camera position y(),camera position z() move object 2,640 set object to camera orientation 2 set object to camera orientation 2 texture object 2,1

rem roll#=wrapvalue(roll#+0.5) rem turn#=wrapvalue(turn#+0.1) rem y#=0-(cos(roll#)_100) rem x#=cos(turn#)_50 rem z#=50+(sin(roll#)*100) rem position object 1,x#,115+y#,z# rem xrotate object 1,wrapvalue(90+roll#) rem yrotate object 1,wrapvalue(180) rem zrotate object 1,0 rem rotate object 1,object angle x(1),object angle y(1),object angle z(1) rem set object to camera orientation 1 rem rotate object 1,90,0,0

sync rem rotate object 1,0,0,0 goto 5

prog1:

rem Loading screen load bitmap "objects\background\background1.bmp",1 copy bitmap 1,0,0,640,480,0,0,0,screen width(),screen height() sync : delete bitmap 1

make object sphere 1,200

load image "objects\background\background2.bmp",1

set object 1,1,0,0,0,1,0,1 set sphere mapping on 1,1 set object specular 1,0 texture object 1,100

rem Sky Setup make object box 2,1100,1000,1000 texture object 2,1 set object cull 2,0 set object light 2,0

rem Camera Setup position camera 0,0,-120 rotate camera 0,0,0

rem Setup ship for cruise x#=0 : y#=-100 : z#=0 position object 1,x#,y#,z#

rem Setup prompt load image "objects\media\gfx\prompt.bmp",2 load image "objects\media\gfx\strapblank.bmp",3 strapx1=0 : sprite 1,strapx1,480-63,2 strapx2=1024 : sprite 2,strapx2,480-63,2 set sprite alpha 1,196 : set sprite alpha 2,196

rem Set particle effect load image "objects\media\gfx\fire.bmp",4 make particles 1,4,40,100.0 position particles 1,0,-500,0 set particle velocity 1,0.2 set particle speed 1,0.004 set particle gravity 1,-3 set particle life 1,2

rem Load and loop space sound load sound "objects\media\sounds\space.wav",1 : set sound volume 1,80 : loop sound 1 load 3dsound "objects\media\sounds\jet.wav",2 : set sound volume 2,0

rem Main loop do

rem Rotate and move ship roll#=wrapvalue(roll#+0.5) turn#=wrapvalue(turn#+0.1) y#=0-(cos(roll#)_100) x#=cos(turn#)_50 z#=50+(sin(roll#)*100) position object 1,x#,115+y#,z# xrotate object 1,wrapvalue(90+roll#) yrotate object 1,wrapvalue(180) zrotate object 1,0

rem Move strap line dec strapx1 : if strapx1<=-1024 then strapx1=strapx2+1023 dec strapx2 : if strapx2<=-1023 then strapx2=strapx1+1024 sprite 1,strapx1,screen height()-63,2 sprite 2,strapx2,screen height()-63,3

rem Move camera with ship slightly position camera 0,135+(y#/1.1),-100 zrotate camera wrapvalue(((cos(turn#)*5)))

rem Set emission position of particles position particles 1,x#,(115+y#)-(sin(roll#)_58),z#-(cos(roll#)_58) rotate particles 1,wrapvalue((0-roll#)-90),0,0

rem Position sound of engine position sound 2,x#,115+y#,z# position listener 0,115,-100 scale listener 0.5

rem Then play engine sound if sound playing(2)=0 then loop sound 2 vol=sound volume(2) : if vol<100 then set sound volume 2,vol+1

rem Update screen sync

rem Endloop loop

Valliante commented 13 years ago

i'm actually curious, would this work? a 3D Environment within a Sphere. The Environment Textures load depending on the Sphere's Position within X,Y,Z Coordinates within 3D Space, the Planets would need to be mapped onto the inside of the Sphere, or would it simply create a very simple Warp Effect? i may continue to look into this. the relevance to the Pioneer Project is that it might create a very good warp effect within 3D Space, by stretching the Textures or adjusting the Sphere. i havn't really spoken to anyone in the chat room because i was wasn't spoken too very kindly, but it's been interesting to share. i enjoy the Pioneer Project, and look forward to playing it.

robn commented 13 years ago

Its not at all constructive to post several screens full of code that aren't directly related to Pioneer and then ask "will this work" - its actually bordering on rude to expect us to invest the time required to fully understand what you're trying to convey. Try to sum it up in a paragraph or two, tops. If you can't keep it that short then its likely you haven't thought it through.

I'm still struggling to see the relevance to Pioneer. We don't have environment textures, and don't have an obvious need for a "warp" effect (unless you see a need).

Last chance, then issue closed. I'm sorry if that seems "unkind" but really, there's plenty of better places on the net to discuss general 3D space game things.

Valliante commented 13 years ago

i actually came earlier to delete the posts. i want to delete it. how do i delete all my posts?

Valliante commented 13 years ago

this is delicate information that i'd like to use in my own project, and i really wanted to share it with someone who appreciates my work. thanks

Valliante commented 13 years ago

and it is in no way bordering on being rude, to simply ask for assistance or for some friendly advice. bye

robn commented 13 years ago

This is not the appropriate forum to ask for assistance or advice. If you want that try gamedev.net or gamedev.stackexchange.com. It is bordering on rude to ask me to spend my limited time reading screens full of text to try and determine if you're describing a bug or feature request for Pioneer only to find that you're talking about something entirely unrelated.