Missing is
- general items
- any sense of game balance
- some win/loss conditions
It didn't get quite as much done on this as I had hoped, but it's
mostly complete. There aren't a whole lot of items presently, but there
a few ways to win, and one way to lose.
I haven't actually tested this on anything besides my own computer. It
will require at least Ruby 1.9 and the ruby ncursesw library (it may
work with the ncurses one, I don't know). Source can be had here:
https://github.com/jmreardon/7drl-2011-starship/archives/41058a9ed9154ce7f61d05a9545e23113295229b
http://localhost:4000/2011/03/storming-the-ship/
I also ended up making a few tweaks (and bug fixes) today, that should make it
better to play.
I don't get it running...
uninitialized constant Main::Random (NameError)
Any ideas? It took me some time to figure out that i need to do something
with ruby-gems and install ncursesw, the readme "Project for the 2011
7DRL Contest" was not helpful either. I'm running ubuntu and have
optionally a win-xp VM.
Thanks
>
> I don't get it running...
>
> uninitialized constant Main::Random (NameError)
>
> Any ideas? It took me some time to figure out that i need to do something
> with ruby-gems and install ncursesw, the readme "Project for the 2011
> 7DRL Contest" was not helpful either. I'm running ubuntu and have
> optionally a win-xp VM.
>
> Thanks
The Random class is part of the standard library, but was only introduced
in Ruby 1.9. Chances are you are running Ruby 1.8.x. You can check with
"ruby -v".
Ubuntu may install the Ruby 1.9 executable as ruby19 (I
haven't the most recent release, so I'm not sure what it is now). If
that's the case, you'll have to change the first line of
bin/Starship-7drl to:
#!/usr/bin/env ruby19
Or execute the script in ruby directly:
ruby19 bin/Starship-7drl
> #!/usr/bin/env ruby19
Hi, thanks for your reply.
ruby -v tells me:
ruby 1.9.1p378 (2010-01-10 revision 26273) [x86_64-linux]
i don't have any ruby19 executable, do you have any other suggestions?
i'd really like to try the game. I give it a try on my v-server, perhaps
its working there.
Thanks
I've pushed a version of the game to GitHub that explicitly tries to load
the random module, I didn't have to do it here, by that's the best I can
think to do. I'm running:
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin10]
but the documentation claims Random is in 1.9.1. You may want to try:
/usr/bin/env ruby -v
since that's what I'm actually calling in the script, just in case
you've got multiple versions of ruby floating around. Could you post the
full trace it gives when the error occurs?
What's the correct URL?
/Björn
Let me do it for him since I am struggling to overcome the same error:
/roguelike/gry/7drl_2011/sts/lib/MapBuilder.rb:80:in `rand': invalid argument - 0.0 (ArgumentError)
from /roguelike/gry/7drl_2011/sts/lib/MapBuilder.rb:80:in `block (2 levels) in processRooms'
from /roguelike/gry/7drl_2011/sts/lib/MapBuilder.rb:76:in `each'
from /roguelike/gry/7drl_2011/sts/lib/MapBuilder.rb:76:in `block in processRooms'
from /roguelike/gry/7drl_2011/sts/lib/MapBuilder.rb:73:in `each'
from /roguelike/gry/7drl_2011/sts/lib/MapBuilder.rb:73:in `processRooms'
from /roguelike/gry/7drl_2011/sts/lib/MapBuilder.rb:48:in `constructMap'
from /roguelike/gry/7drl_2011/sts/lib/GameState.rb:29:in `initialize'
from lib/Main.rb:178:in `new'
from lib/Main.rb:178:in `new_game'
from lib/Main.rb:45:in `start'
from bin/Starship-7drl:3:in `<main>'
By the way I also have ruby 1.9.2.p180 installed. Will try downloading
your fixed version now.
--
Michal Bielinski
>
> Let me do it for him since I am struggling to overcome the same error:
>
> /roguelike/gry/7drl_2011/sts/lib/MapBuilder.rb:80:in `rand': invalid argument - 0.0 (ArgumentError)
> from /roguelike/gry/7drl_2011/sts/lib/MapBuilder.rb:80:in `block (2 levels) in processRooms'
> from /roguelike/gry/7drl_2011/sts/lib/MapBuilder.rb:76:in `each'
> from /roguelike/gry/7drl_2011/sts/lib/MapBuilder.rb:76:in `block in processRooms'
> from /roguelike/gry/7drl_2011/sts/lib/MapBuilder.rb:73:in `each'
> from /roguelike/gry/7drl_2011/sts/lib/MapBuilder.rb:73:in `processRooms'
> from /roguelike/gry/7drl_2011/sts/lib/MapBuilder.rb:48:in `constructMap'
> from /roguelike/gry/7drl_2011/sts/lib/GameState.rb:29:in `initialize'
> from lib/Main.rb:178:in `new'
> from lib/Main.rb:178:in `new_game'
> from lib/Main.rb:45:in `start'
> from bin/Starship-7drl:3:in `<main>'
>
> By the way I also have ruby 1.9.2.p180 installed. Will try downloading
> your fixed version now.
That is a different error. The random number generator doesn't like
being given 0 as an argument, and I messed something up so it is. Is
this happening consistently?
Every time I run Starship-7drl. The game displays briefing and then
crashes. Updated version from github does not differ except it says
"no such file to load -- random (LoadError)"
--
Michal Bielinski
michael@michael-H55M-USB3:~$ /usr/bin/env ruby -v
ruby 1.9.1p378 (2010-01-10 revision 26273) [x86_64-linux]
Your new version doesn't work either...
/home/michael/Downloads/7drl-storm/lib/Main.rb:19:in `require': no such
file to load -- random (LoadError)
from /home/michael/Downloads/7drl-storm/lib/Main.rb:19:in `<top
(required)>'
from ./bin/Starship-7drl:20:in `load'
from ./bin/Starship-7drl:20:in `<main>'
Old version:
/home/michael/Downloads/7drl-storm/lib/Main.rb:19:in `require': no such
file to load -- random (LoadError)
from /home/michael/Downloads/7drl-storm/lib/Main.rb:19:in `<top
(required)>'
from ./bin/Starship-7drl:20:in `load'
from ./bin/Starship-7drl:20:in `<main>'
--
Michael
>
> michael@michael-H55M-USB3:~$ /usr/bin/env ruby -v
> ruby 1.9.1p378 (2010-01-10 revision 26273) [x86_64-linux]
>
> Your new version doesn't work either...
>
> /home/michael/Downloads/7drl-storm/lib/Main.rb:19:in `require': no such
> file to load -- random (LoadError)
> from /home/michael/Downloads/7drl-storm/lib/Main.rb:19:in `<top
> (required)>'
> from ./bin/Starship-7drl:20:in `load'
> from ./bin/Starship-7drl:20:in `<main>'
>
> Old version:
>
> /home/michael/Downloads/7drl-storm/lib/Main.rb:19:in `require': no such
> file to load -- random (LoadError)
> from /home/michael/Downloads/7drl-storm/lib/Main.rb:19:in `<top
> (required)>'
> from ./bin/Starship-7drl:20:in `load'
> from ./bin/Starship-7drl:20:in `<main>'
>
> --
> Michael
Okay, I'm going to have to sit down and see what the proper way to
distribute Ruby programs is, as I'm clearly missing
something. Unfortunately, I won't have the time till the weekend.
Yeah, it surely can't always be this hard... Looking forward to
hopefully getting a chance to play your game once a working release is
out.
--
Darren Grey
Trying to run on Ubuntu with ruby1.9.1 and ncurses for ruby install
still crashes with the message:
$ ruby1.9.1 bin/Starship-7drl
<internal:lib/rubygems/custom_require>:29:in `require': no such file
to load -- ncursesw (LoadError)
from <internal:lib/rubygems/custom_require>:29:in `require'
from lib/Main.rb:19:in `<top (required)>'
from bin/Starship-7drl:20:in `load'
from bin/Starship-7drl:20:in `<main>'
Actually, works with ncursesw library from https://github.com/rlane/ncursesw-ruby
installed.
That's great. I'm still doing a bit of work with it though, so I hadn't
mentioned my updates here yet. I'll have a set of install instructions
up today or tomorrow. Unfortunately, it looks like there is no good way
to distribute a ruby app without requiring the user to compile native
dependencies (ie. curses).
Okay, an updated version is on Github[1]. There are now installation
instructions, and the issues with finding Random should be gone. I was
unable to reproduce the issue Michal reported, so I've added a small
constant to the calculation which should avoid it.
[1]: https://github.com/jmreardon/7drl-2011-starship/archives/552013d5cfdb9a7b64daae445ac4781eb5bf46e7
Seems like i can't get it running....
/home/michael/Downloads/7drl-storm/lib/MapBuilder.rb:99:in `block (2
levels) in processRooms': undefined method `[]' for nil:NilClass
(NoMethodError)
from /home/michael/Downloads/7drl-storm/lib/MapBuilder.rb:93:in
`each'
from /home/michael/Downloads/7drl-storm/lib/MapBuilder.rb:93:in
`block in processRooms'
from /home/michael/Downloads/7drl-storm/lib/MapBuilder.rb:90:in
`each'
from /home/michael/Downloads/7drl-storm/lib/MapBuilder.rb:90:in
`processRooms'
from /home/michael/Downloads/7drl-storm/lib/MapBuilder.rb:65:in
`constructMap'
from /home/michael/Downloads/7drl-storm/lib/GameState.rb:46:in
`initialize'
from /home/michael/Downloads/7drl-storm/lib/Main.rb:196:in `new'
from /home/michael/Downloads/7drl-storm/lib/Main.rb:196:in
`new_game'
from /home/michael/Downloads/7drl-storm/lib/Main.rb:63:in `start'
from ./bin/Starship-7drl:21:in `<main>'
Well that's depressing. This happens to you consistently?
Yes; i already had some trouble getting rubyripper and some other ruby
tools (e.g. redmine) runnig, but this beast is tough.
Okay, I've looked at it a bit and it seems you are getting the same
problem as Michal now (my previous fix just moves the error up a few
lines). The code in question does room generation, so skipping past
these errors is probably not going to do any good. The only thing that
I'd think could cause this is an issue with the config file. I cannot
reproduce it here.
Would you be able to send me the output of this command?
ruby -e 'require "yaml"; settings = YAML::load_file("config.yml"); print settings;'
If you run it in the project directory it'll print a listing of what
Ruby gets when it reads the config file to standard output.
Thanks,
Justin
It's quite a bit, i hope its no problem to post it here.
michael@michael-H55M-USB3:~/Downloads/7drl-storm$ ruby -e 'require
"yaml"; settings = YAML::load_file("config.yml"); print settings;'
{:ending=>{:core_breach=>["You breached the reactor core, causing a",
"catastrophic containment failure, and the ", "complete destruction of
the vessel"], :shield_failure=>["You brought shield power to critical
levels", "while at warp speeds. The ship, no longer able", "to cope with
the stresses, lost hull integrity", "and disintegrated."], :capture=>
["Your efforts to disrupt the rebels' flight allowed", "friendly forces
to intercept and recapture the", "vessel."], :leader_dead=>["After seeing
you the rebels' commander, the survivors", "of your massacre surrender.
You are able to regain ", "control of the ship, and bring it home
safely"], :killed=>["In your efforts to recapture the ship, your were",
"killed by rebel soldiers."]}, :mapSymbols=>{:blank=>[" ", 0], :floor=>
[".", 0], :lift=>["o", 2], :wall=>["#", 0], :hatch=>["=",
1], :hatch_open=>["`", 2], :door=>["+", 2], :door_open=>["'",
2]}, :untraversable=>{:wall=>"There is a wall here", :hatch=>"You'll have
to open this hatch first", :door=>"You'll have to open this door
first"}, :room_templates=>{"Bridge"=>{:count=>1, :levels=>[4], :prereqs=>
{:bridge=>true}, :objects=>[[1, :leader], [1, :crewer], [1, :crewer],
[1, :soldier], [1, :soldier], [0.2, :soldier], [0.2, :soldier],
[1, :marine], [0.5, :marine], [0.5, :marine]]}, "Quarters"=>
{:count=>0.9, :levels=>[0, 7, 1, 6], :prereqs=>{:small=>true}, :objects=>
[[0.4, :charger], [1, :terminal], [0.01, :crewer]]}, "Mess Hall"=>
{:count=>8, :levels=>[0, 7, 1, 6, 2, 5], :crawl=>true, :prereqs=>
{:medium=>true}, :objects=>[[0.5, :crewer], [0.5, :crewer]]},
"Recreation"=>{:count=>4, :levels=>[0, 7, 1, 6], :crawl=>true, :objects=>
[[0.5, :crewer]], :prereqs=>{:medium=>true}}, "Barracks"=>
{:count=>0.1, :levels=>[3, 4, 5], :crawl=>true, :prereqs=>
{:medium=>true}, :objects=>[[0.4, :charger], [0.5, :soldier],
[0.5, :marine], [0.5, :soldier], [0.5, :marine]]}, "Infirmary"=>
{:count=>1, :levels=>[3, 4, 5], :crawl=>true, :prereqs=>
{:medium=>true}, :objects=>[[0.5, :crewer], [0.2, :soldier],
[0.01, :marine]]}, "Briefing Room"=>{:count=>10, :levels=>[2, 3, 4, 5,
6], :crawl=>true, :prereqs=>{:medium=>true}, :objects=>[[0.5, :crewer],
[0.5, :soldier], [0.4, :soldier], [0.2, :soldier], [0.1, :marine],
[0.1, :marine]]}, "Brig"=>{:count=>1, :levels=>[4, 5], :objects=>
[[0.5, :crewer], [0.7, :soldier], [0.7, :soldier], [0.1, :marine]]},
"Reactor"=>{:count=>1, :prereqs=>{:end=>true}, :levels=>[3, 5], :objects=>
[[1, :reactor_core], [0.5, :crewer], [0.7, :soldier], [0.2, :soldier],
[0.2, :soldier], [0.01, :marine], [0.01, :marine]]}, "Science Lab"=>
{:count=>0.2, :levels=>[2, 3, 4, 5], :crawl=>true, :objects=>
[[0.5, :crewer], [0.2, :soldier], [0.5, :marine], [0.3, :energy_armour],
[0.1, :disruptor_rifle]]}, "Lift Support"=>{:count=>1, :levels=>[2, 3, 4,
5], :crawl=>true, :objects=>[[0.5, :crewer], [0.2, :soldier],
[0.01, :marine]], :prereqs=>{:medium=>true}}, "Maintenance"=>
{:count=>0.05, :levels=>[0, 1, 2, 3, 4, 5, 6, 7], :crawl=>true, :objects=>
[[1, [:warp_drive_relay, :shield_emitter]], [0.1, :crewer],
[0.001, :soldier], [0.0001, :marine], [0.2, :container],
[0.5, :container], [0.5, :container]]}, "Propulsion Control"=>
{:count=>1, :levels=>[2, 3, 4, 5], :crawl=>true, :objects=>
[[0.5, :crewer], [0.5, :crewer], [0.2, :soldier], [0.01, :marine]]},
"Weapons Control"=>{:count=>1, :levels=>[2, 3, 4,
5], :crawl=>true, :objects=>[[0.5, :crewer], [0.5, :crewer],
[0.5, :crewer], [0.2, :soldier], [0.01, :marine]]}, "Shield Control"=>
{:count=>1, :levels=>[2, 3, 4, 5], :crawl=>true, :objects=>
[[0.5, :crewer], [0.5, :crewer], [0.5, :crewer], [0.5, :soldier],
[0.01, :marine]]}, "Transporter"=>{:count=>2, :objects=>[[0.5, :crewer],
[0.5, :soldier], [0.01, :marine]], :prereqs=>{:end=>true}, :levels=>[2,
3, 4, 5, 6]}, "Armoury"=>{:count=>8, :levels=>[2, 3, 4, 5,
6], :crawl=>true, :objects=>[[0.5, :crewer], [0.5, :crewer],
[0.5, :soldier], [0.5, :plasma_rifle], [0.5, :plasma_rifle],
[0.5, :recharger_rifle]], :prereqs=>{:medium=>true}}, "Docking Bay
Access"=>{:count=>1, :objects=>[[0.5, :crewer], [0.5, :crewer],
[0.5, :soldier], [0.5, :soldier]], :prereqs=>{:end=>true}, :levels=>[2,
3, 4, 5, 6]}, "Storage"=>{:count=>0.1, :objects=>[[0.2, :charger],
[0.8, :crewer], [0.5, :crewer], [0.1, :crewer], [0.9, :container],
[0.9, :container], [0.2, :container], [0.2, :container],
[0.5, :container], [0.5, :container]], :levels=>[0, 1, 2, 3, 4, 5, 6,
7], :crawl=>true}}, "templates"=>{"construct"=>
{:kind=>:construct, :symbol=>["?",
3], :kill_template=>:wreckage, :capabilities=>[:against_wall]}, "weapon"=>
{:kind=>:item, :symbol=>["/", 1], :capabilities=>
[:weapon], :melee_dam=>1}, "armour"=>{:kind=>:item, :symbol=>["}",
1], :capabilities=>[:armour]}, "creature"=>{:kind=>:creature, :weapon=>
[:plasma_pistol], :mobile=>true, :strength=>3}, "player"=>
{:kind=>:creature, :weapon=>
[:plasma_pistol], :mobile=>true, :strength=>3}}, :objects=>
{:combat_armour=>{:kind=>:item, :symbol=>["}", 1], :capabilities=>
[:armour], :name=>"Infantry Armour", :description=>"Lightweight armour.
Known to occassionally turn a bolt.", :dr=>[2, 4]}, :energy_armour=>
{:kind=>:item, :symbol=>["}", 1], :capabilities=>
[:armour], :name=>"Energy Armour", :description=>"Prototype energy shield
armour.", :dr=>[2, 2], :dr_charge=>[6, 8], :charge=>5}, :battle_armour=>
{:kind=>:item, :symbol=>["}", 1], :capabilities=>
[:armour], :name=>"Battle Armour", :description=>"Heavy infantry
armour.", :dr=>[3, 5]}, :crew_uniform=>{:kind=>:item, :symbol=>["}",
1], :capabilities=>[:armour], :name=>"Crew
Uniform", :description=>"Standard issue crew uniform", :dr=>[0,
1]}, :wreckage=>{:symbol=>["%",
5], :name=>"Wreckage", :kind=>:decor, :description=>"Unidentifiable
wreckage"}, :warp_drive_relay=>{:kind=>:construct, :symbol=>["*",
3], :kill_template=>:wreckage, :capabilities=>
[:against_wall, :warp_damage], :name=>"Warp Drive
Relay", :description=>"A portion of the warp drive power
relay.", :kill_flag=>:warp_damage}, :shield_emitter=>
{:kind=>:construct, :symbol=>["*",
3], :kill_template=>:wreckage, :capabilities=>
[:against_wall], :name=>"Shield Emitter", :description=>"A shield
emitter.", :kill_flag=>:shield_damage}, :reactor_core=>
{:kind=>:construct, :symbol=>["*",
3], :kill_template=>:wreckage, :capabilities=>
[:away_wall], :name=>"Reactor Core", :description=>"The reactor core
itself. It is heavily shielded.", :kill_flag=>:destroy_ship, :health=>
[100, 100]}, :container=>{:kind=>:construct, :symbol=>["H",
3], :kill_template=>:wreckage, :capabilities=>
[:away_wall], :name=>"Container", :description=>"A sealed storage
container"}, :player_marine=>{:kind=>:creature, :weapon=>
[:recharger_carbine], :mobile=>true, :strength=>3, :symbol=>["@",
1], :name=>"You", :description=>"The player", :armour=>
[:combat_armour]}, :terminal=>{:kind=>:construct, :symbol=>["?",
3], :kill_template=>:wreckage, :capabilities=>
[:against_wall], :name=>"Terminal", :description=>"A standard computer
terminal", :action=>:cmd_login}, :charger=>{:kind=>:construct, :symbol=>
["?", 3], :kill_template=>:wreckage, :capabilities=>
[:self_charge], :name=>"Charger Station", :description=>"Rapid recharging
device", :action=>:cmd_charge, :charge=>10}, :crewer=>
{:kind=>:creature, :weapon=>
[:plasma_pistol], :mobile=>true, :strength=>3, :name=>"Crewer", :description=>"An
enemy crewman", :health=>[3, 4], :symbol=>["c", 4], :capabilities=>
[:ai], :fire_range=>10, :stop_msg=>"Crewer: '?? You there!
Stop!'", :armour=>[:crew_uniform]}, :soldier=>{:kind=>:creature, :weapon=>
[:recharger_carbine, :plasma_pistol], :mobile=>true, :strength=>3, :name=>"Soldier", :description=>"A
determined rebel soldier", :health=>[5, 7], :symbol=>["s",
4], :capabilities=>[:ai], :fire_range=>15, :stop_msg=>"Soldier:
'Freeze!'", :armour=>[:combat_armour], :likes=>:hall}, :marine=>
{:kind=>:creature, :weapon=>
[:recharger_carbine, :plasma_rifle, :plasma_rifle], :mobile=>true, :strength=>3, :name=>"Marine", :description=>"A
season veteran", :health=>[9, 12], :symbol=>["m", 4], :capabilities=>
[:ai], :fire_range=>20, :stop_msg=>"Marine: 'Halt!'", :armour=>
[:combat_armour, :battle_armour, :battle_armour], :likes=>:hall}, :leader=>
{:kind=>:creature, :weapon=>
[:disruptor_rifle], :mobile=>true, :strength=>3, :name=>"Rebel
Commander", :description=>"A veteran of the rebellion", :health=>[20,
20], :symbol=>["L", 4], :capabilities=>
[:ai], :fire_range=>30, :stop_msg=>"Leader: 'You will fail
now!'", :armour=>
[:battle_armour], :kill_flag=>:leader_dead, :likes=>:hall}, :plasma_pistol=>
{:kind=>:item, :symbol=>["/", 1], :capabilities=>
[:weapon], :melee_dam=>1, :name=>"Laser Pistol", :description=>"Standard
issue sidearm", :dam=>[1,
3], :acc=>0.8, :acc_drop=>0.02, :charge=>50}, :recharger_carbine=>
{:kind=>:item, :symbol=>["/", 1], :capabilities=>
[:weapon, :self_charge, :self_charge], :melee_dam=>1, :name=>"Recharger
Carbine", :description=>"Light assault rifle. Uses a self-regenerating
power source", :dam=>[4,
5], :acc=>0.75, :acc_drop=>0.02, :charge=>10}, :plasma_rifle=>
{:kind=>:item, :symbol=>["/", 1], :capabilities=>
[:weapon], :melee_dam=>1, :name=>"Plasma Rifle", :description=>"The
assault weapon of choice for the modern marine", :dam=>[6,
7], :acc=>0.7, :acc_drop=>0.002, :charge=>30}, :disruptor_rifle=>
{:kind=>:item, :symbol=>["/", 1], :capabilities=>
[:weapon], :melee_dam=>1, :name=>"Disruptor
Rifle", :description=>"Experiment prototype rifle.", :dam=>[10,
12], :acc=>0.7, :acc_drop=>0.002, :charge=>10}, :recharger_rifle=>
{:kind=>:item, :symbol=>["/", 1], :capabilities=>
[:weapon, :self_charge, :self_charge], :melee_dam=>1, :name=>"Recharger
Rifle", :description=>"Heavy assault rifle. Uses a self-regenerating
power source", :dam=>[7, 9], :acc=>0.75, :acc_drop=>0.02, :charge=>8}}}
--
Michael
> -snip-
> --
> Michael
No differences worth speaking of unfortunately. Sorry, but I have no
idea what is happening here.
Thanks,
Justin
This was not directed at me but you might find my output useful:
--
Michal Bielinski