Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - fuzzy70

Pages: 1 2 [3] 4
31
http://www.bbc.co.uk/news/business-17434328

They had to wait till they had $97.6bn in cash before doing though  :D

Lee

32
GLBasic - en / Sprite handles
« on: 2012-Mar-16 »
Is there a command to change the X & Y handles of a sprite. From what I have made out DRAWSPRITE uses the top left corner (0,0) of the sprite for it's drawing whereas ROTOSPRITE uses the centre of the sprite. Basically I want to rotate around a certain point & not the middle of the image.

If it means me making a routine using polyvectors then that's not a problem but I thought I would check before re-inventing the wheel so to speak  :D

Lee

33
GLBasic - en / Polyvector Question
« on: 2012-Mar-13 »
I have finally got round to playing with the POLYVECTOR command and have a couple of questions. Here is a snippet of my current code
Code: (glbasic) [Select]
// csz=character size in pixels, pchar=the character to plot, colour[]= array of colours
FOR y=0 TO 24
FOR x=0 TO 39

STARTPOLY 0
  POLYVECTOR   (x*csz)*2,       (y*csz)*2,       pchar*csz,      0,   colour[2]
  POLYVECTOR   (x*csz)*2,      ((y*csz)+csz)*2,  pchar*csz,      csz, colour[2]
  POLYVECTOR  ((x*csz)+csz)*2, ((y*csz)+csz)*2, (pchar*csz)+csz, csz, colour[2]
  POLYVECTOR  ((x*csz)+csz)*2,  (y*csz)*2,      (pchar*csz)+csz, 0,   colour[2]
ENDPOLY

NEXT
NEXT

Imagine a text display of 40x25 chars setup as an array DISPLAY[40][25] (ignoring the fact that the above code will just print the same char at the moment). The characters are stored as an image strip 2048px x 8px & the colours are stored in the colour array as I wanted different coloured text without having to create a bitmap font for each colour. After I got my head around the texture co-ords to find the right char the above code works fine, now for the questions  :D

  • Is the above method the best/right way to do it with polyvectors, i.e using polymode 0
  • If not would using mode 2 (strip) be a better way of doing it & if so can POLYNEWSTRIP be used in a loop otherwise I would end up with 40 blocks of polyvector code per line  :D
[li]
[/li][/list]

Lee

34
Was meant to post this ages ago but kept forgetting. If like me you have a large collection of samples this program helps you find them & play them quickly. Just left click to play it or right click to copy the path or open up the containing folder with it selected. You can set which directories to search as well as assign categories to help finding the sample you are after. The latter is basically a filter that rely's on the keywords being in the file name.

It may not be the most powerful sample management program but it is free, quick & easy to use also very handy if like me you have 100's/1000's of sound samples.

Lee

http://sourceforge.net/projects/auralprobe/




35
GLBasic - en / Best Resolution
« on: 2012-Mar-09 »
Hopefully I will explain this correctly  :D

I am nearly at the stage where I feel comfortable with GLB to actually get my arse in gear & write a game (more than likely a remake to start with), just need to play around more with polyvectors really.

Even though I only have the main Win/OsX/Linux targets & none of the mobile ones I think it would be best to code to one resolution then scale the graphics judging by the various posts in the forum. My question is this, What would be a good resolution to use as a base?. For example would it be best to design/layout the game as 1024x768 then scale down for lower resolutions, or something like 800x600 & scale up or down from that. Of course there may be games where scaling fails or specifically targeting a platform, but will cross that bridge when it happens.

Any feedback on what resolution you design your project in would be appreciated.

Lee

36
Bug Reports / LOADSPRITEMEM() example in Docs
« on: 2012-Mar-03 »
Just a simple change needed to the online help. While trying out this command from the example in the help I kept getting compile errors & after a bit of head scratching figured out the problem.
Code: (glbasic) [Select]
LOCAL w%, h%, pix%[]
IF LOADSPRITEMEM("test.png", w%, h%, pix%[])
   MEM2SPRITE(0, w%, h%, pix%[])
   DRAWSPRITE 0,0,0
ENDIF
SHOWSCREEN
MOUSEWAIT

Just swap the "MEM2SPRITE(0, w%, h%, pix%[])" with "MEM2SPRITE(pix%[],0, w%, h%)" will fix it, might have been a simple typo or the array may have been the last parameter in an older version of GLB.

Lee

37
Code Snippets / DotBall
« on: 2012-Feb-29 »
Here is my attempt at making an oldschool dot ball, the rotation code I found laying around in an old word document of mine (along with other snippets) so I cannot say with total honesty if I wrote that part or not  :O

I mainly wrote this as an exercise of using functions in types which is slowly beginning to sink in at last & is probably far from the best example. Any suggestions of improvements or if/where I have failed would be welcomed

Code: (glbasic) [Select]
// --------------------------------- //
// Project: dotball
// Start: Tuesday, February 28, 2012
// IDE Version: 10.244


// FREE-VERSION:
// Need Premium for Features:
// 3D Graphics
// Network Commands
// INLINE C/C+++ code

// SETCURRENTDIR("Media") // go to media files
GLOBAL DB AS dotball, scx, scy

GETSCREENSIZE scx, scy

TYPE point
x
y
z
ENDTYPE

TYPE dotball
xrot
yrot
zrot

ballpoints[] AS point

FUNCTION createball: pointcount

LOCAL theta, phi, loop

DIM self.ballpoints[pointcount]

FOREACH loop IN self.ballpoints[]

theta = RND (180)-90
phi = RND (359)
loop.x = (COS(theta) * 10) * (COS(phi) * 10)
loop.y = (COS(theta) * 10) * (SIN(phi) * 10)
loop.z = SIN(theta) * 100

NEXT

ENDFUNCTION

FUNCTION drawball: sx,sy,sz

LOCAL tmpx, tmpy, tmpz, px, loop, persp, x%, y%, colour%

persp = 400

FOREACH loop IN self.ballpoints[]


tmpy = ((loop.y * COS(self.xrot)) - (loop.z * SIN(self.xrot)))
tmpz = ((loop.y * SIN(self.xrot)) + (loop.z * COS(self.xrot)))
tmpx = ((loop.x * COS(self.yrot)) - (tmpz * SIN(self.yrot)))
tmpz = ((loop.x * SIN(self.yrot)) + (tmpz * COS(self.yrot)))
px = tmpx
tmpx = ((tmpx * COS(self.zrot)) - (tmpy * SIN(self.zrot)))
tmpy = ((px * SIN(self.zrot)) + (tmpy * COS(self.zrot)))
x  = (512 * (tmpx) / (persp - (tmpz))) + (scx/2)
y  = (scy/2) - (512 * tmpy) / (persp - (tmpz))

colour = tmpz + 155

DRAWRECT x,y,2,2,RGB(colour,colour,colour)

NEXT

INC self.xrot , sx
INC self.yrot , sy
INC self.zrot , sz

ENDFUNCTION


ENDTYPE


DB.createball(500)


WHILE TRUE

DB.drawball(1,0.75,0.5)

SHOWSCREEN

WEND



Lee

38
GLBasic - en / Array speeds
« on: 2012-Feb-26 »
While reading an old programming book (2003 so not uber old) I got onto a section about memory access, cache access etc & found something I thought was interesting so decided to test it in GLB. The book is about game coding & the code is in C++ but it's the concepts I was reading it for. Most will prob not find it interesting or any use for it but I found it of interest  :whistle:

Basically (no pun intended) it was saying about how accessing arrays in the wrong order can have an effect on speed & cache hits. His results had more dramatic differences then mine but that was probably down the the cpu's of the time & their respective cache sizes, however I did witness noticeable differences with my translated version of the code.

Code: (glbasic) [Select]
LOCAL n%,n2%, i%, j%, k%, TimeStart, TimeEnd, TimeTaken, DummyVar
n=250
n2=10000
DIM TestData3d[n][n][n]




PRINT "Writing Data to the 3d array",0,0

// Fill 3d array in Column order
TimeStart = GETTIMERALL()
FOR k=0 TO n-1
FOR j=0 TO n-1
FOR i=0 TO n-1
TestData3d[i][j][k]=0
NEXT
NEXT
NEXT
TimeEnd = GETTIMERALL()
TimeTaken = TimeEnd - TimeStart
PRINT "Column order took = "+TimeTaken,0,10

// Fill 3d array in Row order
TimeStart = GETTIMERALL()
FOR i=0 TO n-1
FOR j=0 TO n-1
FOR k=0 TO n-1
TestData3d[i][j][k]=0
NEXT
NEXT
NEXT
TimeEnd = GETTIMERALL()
TimeTaken = TimeEnd - TimeStart
PRINT "Row order took = "+TimeTaken,0,20

SHOWSCREEN

MOUSEWAIT

PRINT "Reading Data from the 3d array",0,0

// Read 3d array in Column order
TimeStart = GETTIMERALL()
FOR k=0 TO n-1
FOR j=0 TO n-1
FOR i=0 TO n-1
DummyVar=TestData3d[i][j][k]
NEXT
NEXT
NEXT
TimeEnd = GETTIMERALL()
TimeTaken = TimeEnd - TimeStart
PRINT "Column order took = "+TimeTaken,0,10

// Read 3d array in Row order
TimeStart = GETTIMERALL()
FOR i=0 TO n-1
FOR j=0 TO n-1
FOR k=0 TO n-1
DummyVar=TestData3d[i][j][k]
NEXT
NEXT
NEXT
TimeEnd = GETTIMERALL()
TimeTaken = TimeEnd - TimeStart
PRINT "Row order took = "+TimeTaken,0,20

SHOWSCREEN

MOUSEWAIT

// Clear 3d array from mem & create 2d one
DIM TestData3d[0][0][0]
DIM TestData2d[n2][n2]

PRINT "Writing Data to the 2d array",0,0

// Fill 2d array in Column order
TimeStart = GETTIMERALL()
FOR j=0 TO n2-1
FOR i=0 TO n2-1
TestData2d[i][j]=0
NEXT
NEXT

TimeEnd = GETTIMERALL()
TimeTaken = TimeEnd - TimeStart
PRINT "Column order took = "+TimeTaken,0,10

// Fill 2d array IN Row order
TimeStart = GETTIMERALL()
FOR i=0 TO n2-1
FOR j=0 TO n2-1
TestData2d[i][j]=0
NEXT
NEXT

TimeEnd = GETTIMERALL()
TimeTaken = TimeEnd - TimeStart
PRINT "Row order took = "+TimeTaken,0,20

SHOWSCREEN

MOUSEWAIT

PRINT "Reading Data from the 2d array",0,0

// Read 2d array in Column order
TimeStart = GETTIMERALL()
FOR j=0 TO n2-1
FOR i=0 TO n2-1
DummyVar=TestData2d[i][j]
NEXT
NEXT

TimeEnd = GETTIMERALL()
TimeTaken = TimeEnd - TimeStart
PRINT "Column order took = "+TimeTaken,0,10

// Read 2d array in Row order
TimeStart = GETTIMERALL()
FOR i=0 TO n2-1
FOR j=0 TO n2-1
DummyVar=TestData2d[i][j]
NEXT
NEXT

TimeEnd = GETTIMERALL()
TimeTaken = TimeEnd - TimeStart
PRINT "Row order took = "+TimeTaken,0,20

SHOWSCREEN

MOUSEWAIT

BTW originally they where separate tests I wrote but then lumped them into one prog & the results where still the same, also trying ints rather than floats produced the same results.

On my system filling the 3d array was on average twice as fast in column order then row order, while reading there was little in it but row order was slightly quicker. The difference does scale with the the size of the array for example the 2d fill with 10000x10000 elements was 3.5 times quicker in column order whereas with 5000x5000 elements around 2 times quicker.

How different the results would be on other platforms like iPhone etc I do not know as not having any of the other platforms I'm unable to test.

If you are filling any large arrays in your project during runtime (except at the initial start) it might be an idea to run this test on the device to see what works quicker if at all. Who knows you may gain a few millisecs that could be used elsewhere or give a boost to updates  :D

Lee

39
Bug Reports / Online help problem.
« on: 2012-Feb-26 »
Am having problems with the inbuilt help in that if I use the Search function then click on List topics it comes up with "No topics found". While I am not 100% certain that it did work before I feel quite confident it did.

I have done all the checks like making sure the help DLL's are registered etc & even tested other .chm help files from other apps & they work fine.

Even searching for commands I know exist comes up with the same problem.

Cheers

Lee

40
GLBasic - en / MEM2SPRITE() question
« on: 2012-Feb-25 »
I might have a use for this command coming up shortly but have a query regarding the help file stating the following

Warning: READ/DATA might probably not read that large negative numbers.

Is that platform specific, a warning from older version of GLB thats not been removed from the help file or something else?

It may happen that I do not need to store the info in data statements but It would be handy to know if there is indeed a limit as to what can be stored in data statements so I can keep it in mind for future.

Lee

41
Off Topic / Ongoing arcade project
« on: 2012-Feb-24 »
I have been slowly collecting items to make my own arcade machine so to speak just for the hell of it & now am another step closer to having all I need to build it.

These are the items I have acquired so far
  • 36 inch TV with built in surround (5.1 DTS, Dolby Pro Logic)
  • Original Xbox version 1.6 (Clear crystal case) modded by me
  • Pair of Half leather car seats from a MGF roadster

All the above items I managed to get for free, the TV was given to me by a friend who replaced it with a 50" Lcd/Plasma, same with the xbox which he gave me a while back when his kids moved over to a 360 & PS3. The car seats came from another friend who was a car dealer that decided to break & sell an MGF he had due to the cost of repairing it was not worth it. Almost all the parts sold except the seats & I was toying with the idea of making a "Top Gear" type sofa with them but that never happened but I do use them as gaming seats though  =D
 
The items that are remaining to get are a steering wheel controller as well as a SFF pc like an old Dell 3100c etc (which I am currently watching one on eBay thats at £1 N/R & 2 days to go).

The reason for an Xbox & a PC is due emulation mainly, the pc will handle the Amiga & MAME side of things as well as remakes that I have accrued over the years, while the Xbox will deal with the 16bit console stuff (Snes, megadrive, Atari 2600 etc). While there is an Amiga & MAME emulator for the Xbox the Amiga side is not as easy to use or as established as the Windows/PC version & MAME is fine for really old games but struggles with some of the later ones. Also my Xbox games are copied onto the HD thanks to the mod.

I have made up adapter cables that allow me to use Amiga/Atari 9 pin digital joysticks on both the PC & Xbox as well as using an Xbox controller on the PC & all works well regarding that. More than likely I will dig out my PICmicro programmer & make an electronic switch box to save the hassle of cable swapping etc.

Luckily having a Dad who's a carpenter will save me a lot of hassle making the frame & base to hold it all in his workshop (also the trade discount on the wood is a huge bonus). I you think of a Sega Rally arcade game cabinet that's the sort of look I will probably go with.

Once I get the wheel controller & the PC then construction will begin  :enc:

Lee

btw the attached pic is not the seats I have as they are still in my mates unit but are the same type

[attachment deleted by admin]

42
Off Topic / Back after an unplanned break
« on: 2012-Feb-23 »
I have been away for over 2 months thanks to my hard-drive deciding it was time to do an impression of a Geiger counter & merrily clicking away like no tomorrow. That's where being unemployed really sucks as saving up for another took a long time as you can see. I could have bought a 2nd hand one from ebay but I've always been cautious with hard-drives, & cpu's for that matter from there as you cannot tell what abuse (if any) they have had.

Good news, have not lost any data thanks to my regular back-up schedule.

Bad news, I cannot for the life of me find my Windows 7 disc & serial so have had to install Vista which is very odd seeing as all my other OS cd's (even back to win98) are present in my PC disc wallet.

I have learn't 1 good lesson though, you can download full disc images of Microsofts OS's from their site & if you are unlucky enough to have to install Vista like I've just done download one for your sanity.

I honestly thought the updates was never going to end, seriously there was around 60 updates & numerous reboots before I even got to the SP1 download, then more again until I got to SP2. Is it just me or I thought the Service packs incorporated all the previous updates  :blink:

Installing all my apps again & updating them was not really fun but a lot less painful than the Vista experience  :D

Now the fun begins trying to remember what I was doing before & getting back into that mindset, still have a few pages of unread posts on this forum to scan through yet & see whats been happening in the land of GLBasic  :good:

Hope you all had a nice Xmas & New Year btw  :booze:

Lee

43
Off Topic / Had to post this pic
« on: 2011-Dec-06 »
Sorry, I had to post this pic here that a friend of mine just posted on FB as it is so apt  :D

Lee

[attachment deleted by admin]

44
Off Topic / Another programming language
« on: 2011-Dec-03 »
I am thinking of learning another language for the sole purpose of creating my utilities like level editors etc. One such utility I need to create is for reading amiga disks (emulated ADF files not originals) as I am planning on making a remake of a classic amiga/st game. I have been toying with the idea of remaking this game for a couple of years now but Blitz3d (my previous language) was not ideally suited to the task thanks to the game being a strategy type with a lot of data that needs monitoring & updating. Thanks to GLB I think it is possible thanks to its vastly superior TYPES system with functions & arrays of TYPES compared to Blitz3d's very basic TYPE system.

I have managed to read the save game disk & work out how the data is stored which enables me to edit it so effectively cheating the game so I can grab info, graphics etc to build up a framework as well as how the game ticks internally. Btw I have completed the game numerous times many years ago when it came out on the Amiga but that was long ago  =D .

All this was done with Blitz3d & a hex editor & was far from ideal but they done the job, well nearly as still have about 20% or so left to do. What I would like is to wrap up the utils into 1 program with a graphical interface so I no longer need the hex editor & Blitz, same goes for any other tools/utils I have written or will write in future.

I am looking for a visual language so I can design the UI without having the hassle of coding it then just assign the code to the relevant elements, also power/speed is not top of the list as I will only be creating tools/utils & not games with it as I will use GLB for them.

Three spring to mind at the moment, Visual C++, Visual C# & Visual Basic, all of which are free which helps  :D . I have discounted C++ due to the time required to learn it & as previously stated I do not need the power etc that C++ provides.

C# I have no idea about & would like to hear from any of you that have any experience in that language as to how difficult it is to learn.

Visual Basic I used back in 2005 when I wrote my diabetic app for my pocket pc & that was done by reading only the commands I needed to use & nothing more. If I looked at the code now I can safely say that most of it would not make any sense to me so would have to start from the beginning again. Also knowing Microsoft & their uncanny ability to make the next release either incompatible or substantially different to the previous version means starting afresh anyway.

I am not knocking DDGUI that comes with GLB, but like I said earlier I want to spend more time coding the program & not have to worry about coding in UI co-ords & such like, less time spent doing the util means more time to spend writing games in GLB.

Any views on C# would be appreciated as well as any other visual languages that I have missed, keeping in mind that the Visual range from Microsoft comes with the huge .NET library helping to cut the amount of written code down.

Also do not ask what the game is I thinking about doing as there have been numerous posts on the web about a remake of it, all of which vanished without a trace & I do not want to be part of that statistic. Plus I want to write/convert other utils so that one is just an example  ;) .

Lee

45
Off Topic / Some input required please
« on: 2011-Nov-24 »
Hi all, I am a Type 1 diabetic (insulin controlled) & have been for 17 years. For the last 3 years I have been controlling the amount of insulin I use by a method called "Carbohydrate Counting", which is based on a very simple formula. My real questions will follow after this description to help show whats involved.

(Portion size grams / 100) * Carbs per 100g = CP's (Carbohydrate Points)
10 CP's = 1 unit of insulin
It is then multiplied by each persons personal ratio, everyone starts at a ratio of 1:1 & it is modified over time based on results from blood tests.

The above looks more complicated than it is practice so will gove a real life example

Wholemeal pasta = 66g per 100g of Carbs
Portion size = 200g
200/100 = 2
2 * 66 = 132 (CP's)
132/10 = 13 units of insulin to be injected (assuming 1:1 ratio)

You also have to factor in what your blood sugar levels are prior to eating & make an adjustment dose of insulin which again is based on a per person basis. My blood sugar target range is 4-8mmol/L & my adjust dosage is 1 unit insulin for 2 mmol/L. So using the above example say my blood result was 10mmol/L before the meal, I would have to inject 15 units of insulin (13 for the food, 2 for the correction dose) to keep my levels within my target range.

All is nice & easy with the above but say you had a meal with more than one item like a roast dinner, you have to calculate the CP's for the potatoes, vegatables, yorkshire puddings etc etc separate & add them up. Just imagine the joys of eating out & having a 3 course meal with starter,main & desert then the math starts getting awkward, still straight forward though just more time consuming. After time you learn meals that you have regular so other than adding a correction dose if needed the math is not needed.


Everything above is very easy for a computer/phone to calculate as well as keep track of. I use my pocket pc when I go out as I wrote a VB.Net app for it along with a SQL database to store the info of the foods & it is probably the most simple program you could write. I select the food type from a drop down list which then produces another dropdown listing the types of food in that group, I then enter the portion size & it keeps a total of the CP's as I add more items.

While this works for me it is not very portable to other devices thanks to using Microsofts SQL compact edition. There are programs I have seen on the net but they tend to be limited in some way or another, like American ones which use ounces instead of grams & provide no inbuilt conversion or do not keep a running total of all the items making up the meal. There are books as well, but carrying a book around with you when going for a meal is not the most practical solution. I have one particular book which is very good in that each food has a photo so you can visually see the size of the portion, but again not very portable/practical while out & also while a phone version could be made the size of the download would be rather large (around 1000+ thumbnails). There is an Iphone version of the book but it has the problem I mentioned earlier regarding not keeping a total of multiple foods & looks like an ebook rather than a program.


Now finally to my questions lol.
As mentioned above the program is really nothing more than a calculator with an attached database of foods, the database would have to be implemented as a flat text file which should not pose to many problems. To cover a wide target audience I thought that IPhone/IPod, Android cover a large part of the market but also Windows phone, Blackberry & a generic JAVA app for the remaining targets. While I have used all the targets I have never owned or developed for any of them so if you could help by answering the following questions that would be very appriciated.

What costs are involved, like Developer fees etc so a rough total to produce an app for that platform & market it.

IPhone/IPod =

Android =

Windows Phone =

Blackberry =

Regarding the java side of things can all the above run a java app & would that be the best way to approach this?

Any thoughts on if such a project like this feasable?


As I am currently not working due to illness (& it's not diabetic related) I would have to source funding to pay for any fees etc mentioned above, for that I would approach a Diabetic organisation or such. I could have searched the net for the above information but would rather hear from actual people like yourselves with real world experience as you are aware of any hidden costs not mentioned on their sites. Ideally I would like the app to be free but may charge a small amount & the procedes go to a Diabetic related charity if that is required, if it makes it easier for others with the same condition as myself thats all I am after.

Sorry for such a long post but could not figure out a way to shorten it.

Lee

Pages: 1 2 [3] 4