Author Topic: Space shooter - full game in development  (Read 4618 times)

0 Members and 1 Guest are viewing this topic.

Offline johannhowitzer

  • Forum Regular
  • Posts: 118
    • View Profile
Space shooter - full game in development
« on: August 14, 2020, 08:24:30 am »
This is a heavily story-driven shmup concept I've been working on for a year, maybe a little longer.  I intend to have a full commercial release when this is finished, though I am likely not going to stick with QB64 all the way through the project, planning to port to C++ eventually, for various reasons.  However, QB64 has provided a very accessible way to hash out my ideas and get the engine off the ground.

The engine is more or less functionally complete, has a few bugs to iron out, but was coded from the ground up.  I may release pieces of the QB64 code at some point, as some of the systems in the engine could easily be repurposed for use in other people's projects.  I am currently making a push for a playable alpha demo, which will be a closed testing phase, only a few copies distributed to people I've already handpicked.

Once the demo is ready, I will be putting most of my effort into getting the bulk of the story content written.  It is very spoiler-sensitive, and I only have some parts fully written out, mostly right now I have the main story beats outlined.  Here's a basic synopsis that stays away from spoilers:

Every so often, someone in the galaxy, usually a major political power, is foolish enough to fund research into time travel.  Whenever this happens, it backfires catastrophically.  Not long ago, one such government declared war on another, and conflicts broke out here and there across the border.  An accident brought about by time travel research crippled this warlike government soon after, and it was quickly routed and forced to sign a cease fire.  Would-be conquerors are slow to learn harsh lessons, though, and the research has begun again in secret, and in violation of the terms of the cease fire.  The story begins on this hidden research station, concealed under an ocean on a primitive planet near the border.

I have attached a screenshot showing the current state of the project, enjoy!  Please note that while some assets were taken from license-free artwork, others are my own work and are subject to copyright.  It's mostly placeholders for now, but if you want to use something yourself, you need to ask first.
gameplay.png
* gameplay.png (Filesize: 30.14 KB, Dimensions: 800x600, Views: 312)
« Last Edit: August 14, 2020, 08:29:53 am by johannhowitzer »

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • View Profile
    • GitHub
Re: Space shooter - full game in development
« Reply #1 on: August 14, 2020, 01:23:59 pm »
Beautiful sprites. Did you make them yourself or are these the assets that came from license-free work?
Shuwatch!

Offline johannhowitzer

  • Forum Regular
  • Posts: 118
    • View Profile
Re: Space shooter - full game in development
« Reply #2 on: August 14, 2020, 01:42:31 pm »
I got planet, ships, and meters from license-free, and did a lot of editing on the meters and ships.  So it's not identical, but yeah not copyrighted.  Almost all weapons, the weapon selector, and the radio communication window are my own work.  The fonts are based on Setback and Kharon, freely available pixel fonts, but I did some edits, coloration and drop shadow for them.  I do not have character art yet, hence the silhouettes.

I'm actually not super happy with the ship sprites, as they're all the same size and they look so similar that it's hard to tell the enemy ship types apart until they fire their weapons.  I expect I'll be making new ones from scratch, but these have worked well for building the engine.


I suppose I should mention some of my inspirations for this project.  You can see Star Fox in the dialogue presentation, visual style is inspired by Gradius V, the ship system resource mechanic (shield, weapon, and engine) is a streamlined version of Solar Winds, the story section presentation will be based on Starwish, story concepts are based on many of my ideas from earlier in life as well as various games I've played, and there's also a strong Ikaruga influence.
« Last Edit: August 14, 2020, 01:55:58 pm by johannhowitzer »

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • View Profile
    • GitHub
Re: Space shooter - full game in development
« Reply #3 on: August 14, 2020, 01:51:12 pm »
I will say it looks quite excellent. I'm looking forward to running a build of it whenever you are comfortable sharing it
Shuwatch!

Offline johannhowitzer

  • Forum Regular
  • Posts: 118
    • View Profile
Re: Space shooter - full game in development
« Reply #4 on: August 14, 2020, 01:58:32 pm »
One thing I am really not comfortable with in QB64 up to this point is that all my image and sound files are just sitting in plain sight, any end user can go in and inspect the sprite sheet and mess with stuff or replace it with their own files.  Is there a way to convert these asset files into some kind of binary file, so the compiled package won't have any recognizable bits?

Offline Gets

  • Newbie
  • Posts: 28
    • View Profile
Re: Space shooter - full game in development
« Reply #5 on: August 14, 2020, 02:55:18 pm »
You can do it with image files. Use memimage to access the image data in memory, dump it to a file, and then load them into a new image. @SMcNeill  made a utility long ago that handles that and compresses the data with zlib so that it's not much larger than ordinary image files on disk.

I don't know what could be done with sound files though; That aspect of QB64 seems to be pretty limited, but you can always try finding a library that handles things better if there really are no native solutions. For example, Dav posted an example of loading a sound from a string using a Win API call:

https://www.qb64.org/forum/index.php?topic=2887.0


Offline PikaPi

  • Newbie
  • Posts: 1
    • View Profile
Re: Space shooter - full game in development
« Reply #6 on: August 14, 2020, 06:27:31 pm »
One thing I am really not comfortable with in QB64 up to this point is that all my image and sound files are just sitting in plain sight, any end user can go in and inspect the sprite sheet and mess with stuff or replace it with their own files.  Is there a way to convert these asset files into some kind of binary file, so the compiled package won't have any recognizable bits?

I am on my phone typing so if someone could help with full code, thank you.

Let me toss out a possible solution that will solve your problem.  This will work with any file.

First use Open "filename.ext" and use LOF() to get the file length.  GET  #f,,strData$ to grab the entire file contents and finally close the original file.

Here is the work around you can keep it simpme or make it more complex depending on your preference.  Either reverse the Data, or scramble the Data and save the new Data to a new file.  As mentioned before you can also use zlib for compression.

Make sure you open the input and output
 files as binary otherwise you may loose data.

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • View Profile
    • GitHub
Re: Space shooter - full game in development
« Reply #7 on: August 14, 2020, 06:41:09 pm »
One thing I am really not comfortable with in QB64 up to this point is that all my image and sound files are just sitting in plain sight, any end user can go in and inspect the sprite sheet and mess with stuff or replace it with their own files.  Is there a way to convert these asset files into some kind of binary file, so the compiled package won't have any recognizable bits?
@johannhowitzer
Here is some code I adapted from Dav's BASIMAGE stuff. The code is currently setup so that you run it as a separate exe and pass the parameters of input file (1) and output file (2). The program will read the picture and save it to what you've chosen. Then you can simply either copy and paste the function that it creates into your main code or you can just $INCLUDE it in your program. The function name is the image handle for the picture you encoded and compressed. Enjoy!

Code: QB64: [Select]
  1. DEFINT A-Z
  2.     IN$ = COMMAND$(1)
  3.     IF IN$ = "" THEN SYSTEM 0
  4.     OUT$ = COMMAND$(2)
  5.     IF OUT$ = "" THEN SYSTEM 0
  6.     SCREEN _LOADIMAGE(IN$, 32): SLEEP 1
  7.     DIM m AS _MEM: m = _MEMIMAGE(0)
  8.     INDATA$ = SPACE$(m.SIZE)
  9.     _MEMGET m, m.OFFSET, INDATA$
  10.     INDATA$ = _DEFLATE$(INDATA$)
  11.     wid = _WIDTH: hih = _HEIGHT
  12.     SCREEN 0
  13.     OPEN OUT$ FOR OUTPUT AS 2
  14.     Q$ = CHR$(34) 'quotation mark
  15.     inFunc$ = LEFT$(IN$, LEN(IN$) - 4)
  16.     FOR i = 32 TO 47
  17.         IF INSTR(inFunc$, CHR$(i)) THEN
  18.             inFunc$ = String.Remove(inFunc$, CHR$(i))
  19.         END IF
  20.     NEXT
  21.     FOR i = 58 TO 64
  22.         IF INSTR(inFunc$, CHR$(i)) THEN
  23.             inFunc$ = String.Remove(inFunc$, CHR$(i))
  24.         END IF
  25.     NEXT
  26.     FOR i = 91 TO 96
  27.         IF INSTR(inFunc$, CHR$(i)) THEN
  28.             IF i <> 92 THEN
  29.                 inFunc$ = String.Remove(inFunc$, CHR$(i))
  30.             END IF
  31.         END IF
  32.     NEXT
  33.     PRINT #2, "FUNCTION __" + StripDirectory(inFunc$) + "&"
  34.     PRINT #2, "DIM v&"
  35.     PRINT #2, "DIM A$"
  36.     PRINT #2, "DIM btemp$"
  37.     PRINT #2, "DIM i&"
  38.     PRINT #2, "DIM B$"
  39.     PRINT #2, "DIM C%"
  40.     PRINT #2, "DIM F$"
  41.     PRINT #2, "DIM C$"
  42.     PRINT #2, "DIM j"
  43.     PRINT #2, "DIM t%"
  44.     PRINT #2, "DIM B&"
  45.     PRINT #2, "DIM X$"
  46.     PRINT #2, "v&=_NEWIMAGE("; wid; ","; hih; ",32)"
  47.     PRINT #2, "DIM m AS _MEM:m=_MEMIMAGE(v&)"
  48.     PRINT #2, "A$ = "; Q$; Q$
  49.     PRINT #2, "A$ = A$ + "; Q$;
  50.     BC& = 1
  51.     DO
  52.         a$ = MID$(INDATA$, BC&, 3)
  53.         BC& = BC& + 3: LL& = LL& + 4
  54.         IF LL& = 60 THEN
  55.             LL& = 0
  56.             PRINT #2, E$(a$);: PRINT #2, Q$
  57.             PRINT #2, "A$ = A$ + "; Q$;
  58.         ELSE
  59.             PRINT #2, E$(a$);
  60.         END IF
  61.         IF LEN(INDATA$) - BC& < 3 THEN
  62.             a$ = MID$(INDATA$, LEN(INDATA$) - BC&, 1): B$ = E$(a$)
  63.             SELECT CASE LEN(B$)
  64.                 CASE 0: a$ = Q$
  65.                 CASE 1: a$ = "%%%" + B$ + Q$
  66.                 CASE 2: a$ = "%%" + B$ + Q$
  67.                 CASE 3: a$ = "%" + B$ + Q$
  68.             END SELECT: PRINT #2, a$;: EXIT DO
  69.         END IF
  70.     LOOP: PRINT #2, ""
  71.     PRINT #2, "btemp$="; Q$; Q$
  72.     PRINT #2, "FOR i&=1TO LEN(A$) STEP 4:B$=MID$(A$,i&,4)"
  73.     PRINT #2, "IF INSTR(1,B$,"; Q$; "%"; Q$; ") THEN"
  74.     PRINT #2, "FOR C%=1 TO LEN(B$):F$=MID$(B$,C%,1)"
  75.     PRINT #2, "IF F$<>"; Q$; "%"; Q$; "THEN C$=C$+F$"
  76.     PRINT #2, "NEXT:B$=C$:END IF:FOR j=1 TO LEN(B$)"
  77.     PRINT #2, "IF MID$(B$,j,1)="; Q$; "#"; Q$; " THEN"
  78.     PRINT #2, "MID$(B$,j)="; Q$; "@"; Q$; ":END IF:NEXT"
  79.     PRINT #2, "FOR t%=LEN(B$) TO 1 STEP-1"
  80.     PRINT #2, "B&=B&*64+ASC(MID$(B$,t%))-48"
  81.     PRINT #2, "NEXT:X$="; Q$; Q$; ":FOR t%=1 TO LEN(B$)-1"
  82.     PRINT #2, "X$=X$+CHR$(B& AND 255):B&=B&\256"
  83.     PRINT #2, "NEXT:btemp$=btemp$+X$:NEXT"
  84.     PRINT #2, "btemp$=_INFLATE$(btemp$)"
  85.     PRINT #2, "_MEMPUT m, m.OFFSET, btemp$: _MEMFREE m"
  86.     PRINT #2, "__" + inFunc$ + "& = _COPYIMAGE(v&): _FREEIMAGE v&"
  87.     PRINT #2, "END FUNCTION"
  88.     SYSTEM 1
  89.     SYSTEM 0
  90. FUNCTION E$ (B$)
  91.     FOR T% = LEN(B$) TO 1 STEP -1
  92.         B& = B& * 256 + ASC(MID$(B$, T%))
  93.     NEXT
  94.     a$ = ""
  95.     FOR T% = 1 TO LEN(B$) + 1
  96.         g$ = CHR$(48 + (B& AND 63)): B& = B& \ 64
  97.         IF g$ = "@" THEN g$ = "#"
  98.         a$ = a$ + g$
  99.     NEXT: E$ = a$
  100. FUNCTION StripDirectory$ (OFile$)
  101.     DO
  102.         OFile$ = RIGHT$(OFile$, LEN(OFile$) - INSTR(OFile$, "\"))
  103.     LOOP WHILE INSTR(OFile$, "\")
  104.     StripDirectory$ = OFile$
  105. FUNCTION String.Remove$ (a AS STRING, b AS STRING)
  106.     DIM c AS STRING
  107.     c = ""
  108.     j = INSTR(a, b)
  109.     IF j > 0 THEN
  110.         r$ = LEFT$(a, j - 1) + c + String.Remove(RIGHT$(a, LEN(a) - j + 1 - LEN(b)), b)
  111.     ELSE
  112.         r$ = a
  113.     END IF
  114.     String.Remove = r$
Shuwatch!

Offline johannhowitzer

  • Forum Regular
  • Posts: 118
    • View Profile
Re: Space shooter - full game in development
« Reply #8 on: August 14, 2020, 08:52:08 pm »
Oh good, so there definitely is a way with image files.  I'm going to hold off implementing this until I'm ready to distribute the alpha demo, as it'll add an extra step between making adjustments to the sprite sheet and testing those adjustments, but this is very helpful, thanks everyone!

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: Space shooter - full game in development
« Reply #9 on: August 14, 2020, 10:28:43 pm »
Oh good, so there definitely is a way with image files.  I'm going to hold off implementing this until I'm ready to distribute the alpha demo, as it'll add an extra step between making adjustments to the sprite sheet and testing those adjustments, but this is very helpful, thanks everyone!

You can use the same trick to package sound files in your BAS file.  You'll just need to extract the resources for use, but it'd stop the user from altering them on you.  (And most likely, they wouldn't even notice it working behind the scenes.)
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!