May 27, 2020, 12:28:58 PM

Author Topic: How Many Using Pure Basic  (Read 5597 times)

Offline Steve Elliott

  • Hero Member
  • *****
  • Posts: 2445
Re: How Many Using Pure Basic
« Reply #15 on: November 14, 2019, 08:44:46 AM »
Quote
Also I'm sure that with 10,000 + lines of code there is much scope to create modules?

AGK has modules?  Or are you just suggesting breaking-up the program into separate files?
Windows 10, 64-bit, 16Gb RAM, CPU Intel i5, 3.2 GHz, Nvidia GeForce GTX 1050 (2Gb).
MacOS Catalina, 64-bit, 8Gb RAM, CPU Intel i5, 2.3 Ghz, Intel Iris Plus Graphics 640 1536 MB.
Linux Mint 19.3, 64-bit, 16Gb RAM, CPU Intel i5, 3.2 GHz, Nvidia GeForce GTX 1050 (2Gb).
Raspberry pi 3 and 4.

Offline Qube

  • Administrator
  • Hero Member
  • *****
  • Posts: 2369
Re: How Many Using Pure Basic
« Reply #16 on: November 14, 2019, 03:28:46 PM »
AGK has modules?  Or are you just suggesting breaking-up the program into separate files?
Yeah, I mean breaking up the code into sections that can be reused ( or easily separated ) and use #insert rather than have one huge single source.
Until the next time...

Offline Steve Elliott

  • Hero Member
  • *****
  • Posts: 2445
Re: How Many Using Pure Basic
« Reply #17 on: November 14, 2019, 03:34:58 PM »
Quote
Yeah, I mean breaking up the code into sections that can be reused ( or easily separated ) and use #insert rather than have one huge single source.

Yes that's a much better choice than one big 10,000 line file for just one particular project.  What if you want to re-use some code for another project?  Just write some useful game functions that can be stored in separate files, then include them in the main source file with a simple insert command that your language supplies.
Windows 10, 64-bit, 16Gb RAM, CPU Intel i5, 3.2 GHz, Nvidia GeForce GTX 1050 (2Gb).
MacOS Catalina, 64-bit, 8Gb RAM, CPU Intel i5, 2.3 Ghz, Intel Iris Plus Graphics 640 1536 MB.
Linux Mint 19.3, 64-bit, 16Gb RAM, CPU Intel i5, 3.2 GHz, Nvidia GeForce GTX 1050 (2Gb).
Raspberry pi 3 and 4.

Offline Pfaber11

  • Hero Member
  • *****
  • Posts: 545
  • Bonjour
    • FABERSGAMES
Re: How Many Using Pure Basic
« Reply #18 on: November 14, 2019, 05:52:11 PM »
What took up all those lines of code was the way I was checking to see if I was in collision with an orb or one of the pieces of food and repeated for all twelve levels . I  think that accounted for 4000 lines . I do like the end result though and it plays good but yeah I probably could have been a lot more economic with my coding . Code folding sounds good and yes insert could of been used but I just wanted to make it all in one piece. I was reading somewhere that some games are around 1000000 million lines of code so they must break it up. so nearly half my program was taken up by collision routines . with some clever programming I could of probably got it down to 500 by reusing the code for each level but just chose to copy and paste huge chunks of it which was very quick to do . I nearly wrote not quite but nearly 12 games if you know what I mean.
Celeron N3060 1.6 ghz duel core  4 Gb ram 32 gig storage  HD400 Graphics 160 gig external hard drive....

Offline STEVIE G

  • Sr. Member
  • ****
  • Posts: 412
Re: How Many Using Pure Basic
« Reply #19 on: November 14, 2019, 06:21:43 PM »
What took up all those lines of code was the way I was checking to see if I was in collision with an orb or one of the pieces of food and repeated for all twelve levels . I  think that accounted for 4000 lines . I do like the end result though and it plays good but yeah I probably could have been a lot more economic with my coding . Code folding sounds good and yes insert could of been used but I just wanted to make it all in one piece. I was reading somewhere that some games are around 1000000 million lines of code so they must break it up. so nearly half my program was taken up by collision routines . with some clever programming I could of probably got it down to 500 by reusing the code for each level but just chose to copy and paste huge chunks of it which was very quick to do . I nearly wrote not quite but nearly 12 games if you know what I mean.

You repeated the same code 12 times ... so each level has it's own code?!   :o That's a maintainance nightmare!  I hate to be harsh but getting your code down to 500 lines by not repeating the same same code is not clever programming - it should be standard practice.   ;D   

Offline Derron

  • Hero Member
  • *****
  • Posts: 2972
Re: How Many Using Pure Basic
« Reply #20 on: November 14, 2019, 06:36:22 PM »
Quote
I nearly wrote not quite but nearly 12 games if you know what I mean.

You wrote 12 times the same game :D


bye
Ron

Offline Pfaber11

  • Hero Member
  • *****
  • Posts: 545
  • Bonjour
    • FABERSGAMES
Re: How Many Using Pure Basic
« Reply #21 on: November 14, 2019, 07:39:38 PM »
Yes it was just the easiest way to go at the time . The end result was pretty good though . But I do agree was very bad practice.
I think for my next project I'll do a flow chart first haven't done one in years but I think it's the way to go .
Celeron N3060 1.6 ghz duel core  4 Gb ram 32 gig storage  HD400 Graphics 160 gig external hard drive....

Offline Pfaber11

  • Hero Member
  • *****
  • Posts: 545
  • Bonjour
    • FABERSGAMES
Re: How Many Using Pure Basic
« Reply #22 on: November 14, 2019, 08:21:16 PM »
When I think about it now it was crazy but it did the job very well . Then problem with it was when making small alterations I was having to do it not once but many times and it meant sorting through thousands of lines of code . Not difficult but hard work. I really need to start a new project but haven't found the right inspiration yet . It will be my first outing with purebasic and am really looking forward to it . Been playing around with terrain the last few days and I love it . A year ago I would of considered my own terrain as unobtainable and now I'm doing it . Been using a camera to create height maps and it works great and every one I make is unique and they are pretty huge . It takes ages to get from one side to the other and it's really got a great feel to it . I think the same method I used would work great in AGK2 or studio just as well . I did notice some software for photographing objects and turning them into 3d objects so I think I'm going to build a small studio to do this . I love programming and photography and have a reasonably decent camera . Want to get all this accomplished this year so got to get my skates on . Have any of you guys tried making 3d models with the camera method and if so was it practical . I was thinking a days work when I get it set up say 5 to 20 models .
Celeron N3060 1.6 ghz duel core  4 Gb ram 32 gig storage  HD400 Graphics 160 gig external hard drive....

Offline Kris

  • Jr. Member
  • **
  • Posts: 99
Re: How Many Using Pure Basic
« Reply #23 on: November 14, 2019, 11:30:18 PM »
@Pfaber11 C'mon man! Admit it! You just come here to troll.

 ;D

Offline Pfaber11

  • Hero Member
  • *****
  • Posts: 545
  • Bonjour
    • FABERSGAMES
Re: How Many Using Pure Basic
« Reply #24 on: November 15, 2019, 12:54:13 AM »
Kris I'm here to meet like minded people seriously . If I'm trolling it's not on purpose . I seriously like this forum. This purebasic is coming on great my terrain is looking ace . The speed is awesome too easily reaching 60 fps . put a counter in my program and see how many frames it hits at ten seconds.
Celeron N3060 1.6 ghz duel core  4 Gb ram 32 gig storage  HD400 Graphics 160 gig external hard drive....

Offline Kris

  • Jr. Member
  • **
  • Posts: 99
Re: How Many Using Pure Basic
« Reply #25 on: November 15, 2019, 04:01:02 AM »
OK. Sorry...my bad.   ::)

I'm not talking from experience since I do mostly manual modeling myself and you'll probably get lot's of useful info about this on other dedicated forums or fellow syntaxbombers with more hands on knowledge than mine but as far as I know photogrammetry requires many pictures from many angles. More the better. Once you loaded all pictures into the chosen app there will be some processing time depending on your computer specs and settings. After the process you'll get a very dense model that needs cleaning. Less cleaning if you use it as a static model in offline rendering (standalone CG animation/movie FX) where polygon count is less of an issue. Much more cleaning/optimization is needed if you want them in realtime application such as games. If you want to make them suitable for in game characters and animate them with bones that needs lots of work and in certain situation it's better to remodel certain parts or the whole model using the raw, dense 3D object as a reference. This might be a preferred method anyway if you want fairly low poly objects.

I think it will be a slow process in the beginning. Your first models might take days per model before they're suitable for your game. You'll find out your way but photogrammetry is not a magic bullet but indeed a very useful tool. 

Offline Pfaber11

  • Hero Member
  • *****
  • Posts: 545
  • Bonjour
    • FABERSGAMES
Re: How Many Using Pure Basic
« Reply #26 on: November 15, 2019, 09:22:44 AM »
Thanks Kris I think you need at least 20 photos to accomplish this but for someone who can't draw to save his life like me it may be a way to make my models . I think I'm gonna need a tripod and a large piece of grey card for the backdrop. I did look into this about a year ago but never got around to trying it . Can't remember where I got the software but will find it again .
   some lighting too. I think I maybe a bit optimistic about how many I can produce it may turn out a day to do the photography and a day to clean it up . If this works though it would be awesome I guess I would have to make the textures too . I think once set up and I've got the hang of it it could be good , of coarse it maybe it's not very good and the quality is rubbish but I won't know until I have a go .
Celeron N3060 1.6 ghz duel core  4 Gb ram 32 gig storage  HD400 Graphics 160 gig external hard drive....

Online iWasAdam

  • Hero Member
  • *****
  • Posts: 1713
Re: How Many Using Pure Basic
« Reply #27 on: November 15, 2019, 10:23:18 AM »
@Pfaber11
Quote
When I think about it now it was crazy but it did the job very well
Absolutely NOT! It did the job, but 'well', not and 'very' completely not! You did a terrible job. that fact it works at all is pure luck on your part! You lack of skill in ignoring people and their suggestions on how to improve is amazing.

how to check for a simple collision for 2 objects (size of 1):

xlength = object1x-object2x
ylength = object1y-object2y
length = sqrt( xlength + ylength )
if length < 1 then collide

say object1 is you and object2 is something (repeat for multiple collision)
4 lines of code. say 10 with a loop checking multiple things

You code = 4000-5000 lines of code. above code = 10 lines of code. your coding skills are terrible - please learn. other wise you are really just being a troll going on 'how good you are', and then wanting praise for <something>

<rant over>

Offline Derron

  • Hero Member
  • *****
  • Posts: 2972
Re: How Many Using Pure Basic
« Reply #28 on: November 15, 2019, 11:08:34 AM »
Quote
xlength = object1x-object2x
ylength = object1y-object2y
length = sqrt( xlength + ylength )
if length < 1 then collide

Dimensionless points? Objects tend to have at least a width and height - so it requires a bit more. For points you could simply do "if object1x = object2x and object1y = objext1y then collide"

Or do I miss some trick here?

bye
Ron

Online iWasAdam

  • Hero Member
  • *****
  • Posts: 1713
Re: How Many Using Pure Basic
« Reply #29 on: November 15, 2019, 11:29:41 AM »
He's using just a flat 2d map - no height needed.

To get different width, just modify the length < 1 to something else like length < 0.5 or length < 2 etc. Without seeing how the x/y positions are being used, you can't get a perfect match - it's really just a pseudo-code approach :)

if you wanted to add height, you could do it by adding z to the sqrt or doing a quick height check on the return values - all very simple stuff.




 

SimplePortal 2.3.6 © 2008-2014, SimplePortal