User Tag List

Results 1 to 9 of 9

Thread: Starfield problem - Mathmaticians Needed

  1. #1
    Clicker Fusion 2.5
    ayejes's Avatar
    Join Date
    Feb 2008
    Posts
    83
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Starfield problem - Mathmaticians Needed

    This starfield is buggy. When the ship is decelerating in one direction it does okay but not in other directions. In one deceleration direction it just comes to a complete stop. Also at various times the stars drift when the ship comes to a stop.

    Please note that I can not set the stars position like I had done originally by using the opposite direction of the ship as this was causing problems with other sprite movements. The problem arises with trying to get the stationary ship to move close to other sprites. I had gotten all kinds of odd movements where sprites where suddenly jumping on top of the ship to where you could never catch up to a sprite. So I need to manually set each x,y coordinate of the stars.

    I am using the cos and sin of an angle to get the x,y coordinates. I tried converting them to radians but it did not work. Orginally when I first started working on this game in c I was using radians but the same formula is not working. In c, I would offset the angle degrees by 90 and then multiplied the result by 0.0174553292 (which is pie/180).





    Attached files Attached files

  2. #2
    No Products Registered

    Join Date
    Jun 2006
    Location
    Land of raging rockets
    Posts
    1,231
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Starfield problem - Mathmaticians Needed

    Wow.. no offense but.. those are LOTS of events for not a whole lot.. woah.

  3. #3
    Clicker Fusion 2.5
    ayejes's Avatar
    Join Date
    Feb 2008
    Posts
    83
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Starfield problem - Mathmaticians Needed

    I agree but since I am not actually moving the ship at all but rather moving the entire universe around the ship, it has to be coded differently. I had tried moving the stars in relation to the ships direction but when I added sprites I had the problem of the ship never being able to catch up, no matter how much greater the ships speed was set at over the sprites. Besides that, when ever the ship changed direction every object changed direction as well. After countless hours of trying new ways I gave up and went to coding the x,y coordinates manually. Also mmf does not allow wrapping of static objects. I had numerous bugs when using any other movement, so I had to use static. So, since I had to use static, I had to manually wrap the x,y coordinates without using mmf. Thus many lines of code. This is nothing compared to all the lines of code in the game itself, since each object in the game has to have it's own wrapping sub routine.

    The star field routine seemed easy at first until I started adding asteroids and enemy objects. So by all means if anybody has a better idea than what I have done, I would love :grin: - LOVE :grin: :grin:, and I mean really LOVE :grin: :grin: :grin: to see it.

    That is not sarcasim, I am just very frustrated over the complexitiy of what I thought was going to be simple compared to coding this in c. I actually do have this game coded in c, but I moth balled it due to it crashing to much. And at that it is coded for dos using allegro and either borland or djgpp. Which back then djgpp was not as well documented as it has become. All in all I worked on porting it over to mmf because I don't know windows programming and I just don't have the time to learn.

    I am presently working an a nonprofit business model for a nonprofit organic farm to help the needy and the ecology of this planet. We are being poisened by pesticides, which are also killing off the samon in the rivers, we are being fed hybrid food which is lacking in nutrition (in fact hybrid food helps to increase body weight) and the farm land in the U.S. is shrinking at an alarming rate. Besides all this, part of the U.S. high health care cost is due to a lack of minerals in there food supply (hybrid foods). To which end I do have university studies to back all of these statements.

    But getting back to my point, I don't have time to learn windows programming with all the time I have been commiting to studying our food supply and working on starting a nonprofit company.

    Daniel

  4. #4
    No Products Registered

    Join Date
    Jun 2006
    Location
    Land of raging rockets
    Posts
    1,231
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Starfield solution - idea of trigonometry needed

    Wrapping sub routine??

    Alright. Cause I'm such a nice person, here's the solution to your problem (in the attachment). Just copy the actions in Wrapables and Unwrapables to your objects, set up their alterable values like the example objects and your done. Wrapables are objects that are wrapped and have extra values "width" and "height" that specify how far they have to be out of the view until they wrap around.

    EDIT: oh, and you could also use qualifiers for the wrapables and unwrapables, but I didn't set them up so the code is still readable (wouldn't it be great if qualifiers would show the names of the variables? *HINTHINT* just the first names it finds of any object in the qualifier, that'd totally do the trick.. hi clickteam )

    I have deviated from your solution to "moving everything else". In my solution every object still has a position - which means if the player returns to a previous position he will find the objects there that he saw when he left off. The player is still centered and the stars appear to move, but they are actually static. Enjoy. No extensions involved.
    Attached files Attached files

  5. #5
    No Products Registered

    Join Date
    Jun 2006
    Location
    Land of raging rockets
    Posts
    1,231
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Starfield solution - idea of trigonometry needed

    Hm. I just bothered to take a closer look at the code you wrote and you were actually quite close to the solution.

  6. #6
    Clicker Fusion 2.5
    ayejes's Avatar
    Join Date
    Feb 2008
    Posts
    83
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Starfield solution - idea of trigonometry needed

    Thank you very much for your code example. But after playing with it, it still has problems for me. When I add movement to the enemey sprite, the ship has problems with catching up to it. I would be interested in seeing if you could add movement to your example. In my game I have asteroids which needs to have it's own movement that is independant of the ship.

    As far as the game I am working on goes, I have had to go back to my original long coding method. I did solve the problem I was having with my code. The biggest problem was the order of mathmatical events which was solved with perenthesis to make sure the equation was being performed in the right order.


    Thanks
    Daniel

  7. #7
    No Products Registered

    Join Date
    Jun 2006
    Location
    Land of raging rockets
    Posts
    1,231
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Starfield solution - idea of trigonometry needed

    Alright. Here's another one. This time with enemies that shoot and hunt the player.

    Enjoy
    Attached files Attached files

  8. #8
    Clicker Multimedia Fusion 2
    dragonguy's Avatar
    Join Date
    Apr 2008
    Location
    RULE BRITANNIA!
    Posts
    3,071
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Starfield solution - idea of trigonometry needed

    hmmm in my opinion a good idea would be to use an advanced direction object

  9. #9
    No Products Registered

    Join Date
    Jun 2006
    Location
    Land of raging rockets
    Posts
    1,231
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Starfield solution - idea of trigonometry needed

    And what is that supposed to solve? It used to be a good extension. But it is not vitalized and the Clickteam Movement Controller can do pretty much the same.

Similar Threads

  1. 3D Starfield flyby
    By BigHatLogan in forum File Archive
    Replies: 1
    Last Post: 6th December 2013, 03:31 PM
  2. Pseudo 3D Starfield (APK + MFA)
    By CrystalNoir in forum Android Export Module Version 2.0
    Replies: 3
    Last Post: 27th March 2012, 10:02 AM
  3. Scrolling starfield
    By Farflame in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 16th May 2009, 03:13 PM
  4. Starfield
    By ayejes in forum File Archive
    Replies: 0
    Last Post: 2nd March 2008, 06:19 PM
  5. reverse starfield?
    By ayejes in forum File Archive
    Replies: 4
    Last Post: 29th February 2008, 01:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •